21
eikke
Smarty template string modifiers
  • 2004/2/2 13:09

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


I searched the forums, but couldn't find an answer on this: is it possible to use string modifiers in module template files? I tried it, but it seems not to work?

Like this:
<{$mystring|capitalize}>

Thanks!!!



22
eikke
Re: xoopsModuleConfig in search and block
  • 2004/1/28 16:52

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


You are my hero. Thanks a lot!!!



23
eikke
Re: xoopsModuleConfig in search and block
  • 2004/1/28 16:32

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Got another issue now: Im trying to do this in a block.
I made a file modules/mymodule/include/config.inc.php, I include it in blocks/block.php.
Now this is what I have in config.inc.php:
function getConfig($name){
        global 
$xoopsModule;

        if(!isset(
$name) || $name=='') return null;

        
$xoopsDB=& Database::getInstance();

        
$sql="SELECT conf_value FROM ".$xoopsDB->prefix('config')." WHERE conf_modid=".$xoopsModule->mid()." AND conf_name='".$name."' LIMIT 1";

        
$res=$xoopsDB->query($sql);
        list(
$ret)=$xoopsDB->fetchRow($res);

        return 
$ret;
}

This function does what it is told to do, except... one problem: the module id it gets is the one of that on the front page, not the one of the module providing the block (I get 14, should be 10).
So I removed that conf_modid thing, and search only for the conf_name. I hope that one is unique... but it could be otherwise :( Any way to solve this?



24
eikke
Re: '...' are added in some profile fields
  • 2004/1/28 16:24

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Indeed, same issue here (discovered it yesterday)



25
eikke
Re: xoopsModuleConfig in search and block
  • 2004/1/28 10:02

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


So it is not possible. Thanks, now I know what to do: get it from the DB.
I just wanted to know wether it was possible, because if it was, it's always better to use the method the framework provides, isnt it?
Ok, now up to search how XOOPS stores preferences :)

Thanks for the information!!!



26
eikke
xoopsModuleConfig in search and block
  • 2004/1/28 8:31

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


I searched the forums once more, and found out this question has been asked twice or something, both without a result.
I really need to get access to $xoopsModuleConfig, now both in blocks/block.php, and in include/search.inc.php, twice for the same reason.
Isnt there any way to access it? I dont think I can query the database directly, and thats not a good solution either.
Of course I could put some variables in a php file, maybe even define()s, and include it everytime. But thats not a nice solution either.
The preferences capabilities of XOOPS are great, if I could access the settings

Thanks!!!



27
eikke
xoopsModuleConfig in search
  • 2004/1/27 9:54

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Hija.
I'm writing a module, and implemented a basic search functionality, which gets its results from a remote server (I mean, it gets the results from a remote server, and includes them in the 'search results' of the standard XOOPS search).
To get these remote results one needs a sort of password, and a userid.
First I hardcoded these values in include/search.inc.php, but I want them to be configured from within the admin panel, using the standard XOOPS configuration possibilities ('Preferences').
The 'Preferences' thing is working, but I cannot use the results in my search function I did it like this:
function mysearchfunction(blablabla) {
    global 
$xoopsModuleConfig;
    
//blablabla
    
soSomeSearchFunction($querystring[0], $xoopsModuleConfig['pass']);
}

If I print_r xoopsModuleConfig, nothing is desplayed, and the search functionality doesnt work either. Of course this isn't my real code, just a sample of my problem.

Is there any way I can solve this?

Thanks, Ikke



28
eikke
Block by referer
  • 2004/1/19 12:32

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Ive got a Xoops-powered website, and I'd need a feature: if people come from a certain URL (well, some URLs), and they come to my site (so their referer is one of those URLs), they should get a blank screen or whatever, and a cookie should be set, so I can track them (when they try to come back, even originating from another site, they still should get a blank screen). So if a visitor comes to my site, originating from one of those URLs, they should never be able to visit my site (well, unless they clear their cookies).
I know how to code PHP, thats no problem, but I have no idea *where* to modify some things... I could do it in /index.php, but then a user would be allowed to visit /modules/news/index.php etc... Its a bit stupid to edit every possible .php file in my site

Any help would be very appreciated!

Thanks, Ikke



29
eikke
Re: IFrames module
  • 2004/1/15 10:34

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Ive got a quick hacked IFrame module on my site. Altough currently I have one problem: it's not 100% right in Internet Explorer (it is in Firebird), and if the text of the page inside the frame is broader than the width of the iframe, the text is partially invisible. I'd want it to be wrapped, but didnt figure out yet how to get that.
The height is adapted automatically to the height of the page inside the frame.
Check it out on eikke.com, the 'CVS' module.




TopTop
« 1 2 (3)



Login

Who's Online

252 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 252


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