31
ralf57
Printing XOOPS_URL,XOOPS_ROOT_PATH,etc... in language defines?
  • 2005/1/31 9:10

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


I need to print the value of XOOPS_URL and XOOPS_ROOT_PATH inside my language defines (modinfo.php).
I've tried with
define("_MI_MYCONSTANT""The value is XOOPS_URL");

but it obviuosly outputs
The value is XOOPS_URL

instead of
The value is http://www.mysite.com

Is it possible to have XOOPS_URL,etc interpreted in
language defines?
And if so,which is the correct synthax?
Thanks in advance,ralf.



32
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/21 18:07

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Ok,this did the trick.
Now i have to test it with my code and
let you know.



33
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/21 16:45

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Updates:
i've tried with this code,as you suggested
<?php

error_reporting
(E_ALL); #*#DEBUG#

include '../../mainfile.php';
include_once 
XOOPS_ROOT_PATH '/header.php';

var_dump('xoopsModuleConfig'$xoopsModuleConfig); #*#DEBUG#

echo '<br /><br />';

$fck_uploads_dir $xoopsModuleConfig['fck_uploads_dir'];

echo 
'I am $fck_uploads_dir, the uploads directory!!!';

include_once 
XOOPS_ROOT_PATH '/footer.php';

?>


but had this result (the variable doesn't get the value):

string(17"xoopsModuleConfig" array(2) { ["fck_uploads_dir"]=>  string(7"uploads" ["fck_all_ext_files"]=>  string(91""zip","doc","xls","pdf","rtf","csv","jpg","gif","jpeg","png","avi","mpg","mpeg","swf","fla"" }

I am $fck_uploads_dirthe uploads directory!!!


I've also tried to place this file (testconfig.php9 into the root of "news" module (replacing fck_uploads_dir with one of the news config options,of course) and had the same result.
What else can i try?



34
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/21 15:57

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


I'll try and let you know...
Thanks again.



35
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/21 15:11

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Ok dave,
i have put the code you provided into the root of my module (fckeditor,a port i'm doing) and got this result.
string(17"xoopsModuleConfig" array(2) { ["fck_uploads_dir"]=>  string(7"uploads" ["fck_all_ext_files"]=>  string(91""zip","doc","xls","pdf","rtf","csv","jpg","gif","jpeg","png","avi","mpg","mpeg","swf","fla"" }

It seems to correctly retrieve the config options,right?
But now 2 questions:
1)how can i "extract" these values?
2)i have to use these config values in a page that will not be shown but only used as config file.
I hope i was clear.



36
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/21 13:26

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you Dave,
i've tried with this code:
<?php
include 'mainfile.php';
var_dump('xoopsModuleConfig'$xoopsModuleConfig);
?>

and i get this error:
string(17"xoopsModuleConfig" NULL Notice [PHP]: Undefined variablexoopsModuleConfig in .... file test.php line2

What does this mean?
I'm afraid i'm not doing things right...



37
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/21 13:11

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


It's really strange but i still wasn't able to use the module's config otions inside the module's own pages.
Need some simple example.
Let's say i have "mymodule" and i have set some config options in xoops_version.php file:
$modversion['config'][1]['name'] = 'first_otion';

$modversion['config'][2]['name'] = 'second_otion';

etc...
What is the right code/syntax to use these values inside my code?
I'd rather to have an example with the "echo" command.
Thanks again,ralf.



38
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/19 23:05

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


One last thing:
can i put the value into a variable?
I tried this but i'm not sure it's the right way...
$myvar getConfigValue($myconfig_name);



39
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/19 21:52

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you mith,
i'll try this and let you know.



40
ralf57
Re: Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/19 15:43

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Thank you mith,
clear as always.
I need to retrieve the config options values from
the global variable $xoopsModuleConfig;
let's say my module is named "mymodule"
which is the correct synthax to retrieve these values?
Does this depend on the context (ex.in a function,in a .php file,etc..)?




TopTop
« 1 2 3 (4) 5 6 7 ... 13 »



Login

Who's Online

182 user(s) are online (76 user(s) are browsing Support Forums)


Members: 0


Guests: 182


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits