41
ralf57
Need some pointers on $xoopsModule and $xoopsModuleConfig
  • 2004/12/19 10:28

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i'm trying to build my first module.
I need to understand what $xoopsModule and $xoopsModuleConfig are used for and,most important,i need to know how to use them.
I've checked both the wikis on xoops.org and dev.xoops.org but i need an easier explaination.
So far i've only able to know that these global variables contain modules config options but i wasn't able to retrieve these options to use them.
Thanks in advance for the patience,ralf.



42
ralf57
How to add custom general config options?
  • 2004/12/14 16:02

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i need to build a custom page in admin area where i should set some general options like
Preferences Main »» User Info Settings
or
Preferences Main »» Mail Setup
i should have something like
Preferences Main »» My custom settings.
For modules this is easily done by adding
$modversion['config'][3]['name'] = 'option';
but i wasn't able to add new general options like i
explained above.
Is it possible?and if so,how?
Thanks in advance,ralf.



43
ralf57
Re: Installation blank page (peculiar case)
  • 2004/11/17 10:51

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


I finally solved by myself.
I've found that the MySQL module was not enabled by default in my php.ini so i just uncommented the line,restarted apche and evertything worked fine!!!



44
ralf57
Installation blank page (peculiar case)
  • 2004/11/17 10:13

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i'm experiencing a strange problem trying to install XOOPS 2.0.7.3 on my
Linux box with Apache 2.0.50/PHP 4.3.8/Mysql 4.0.20
I've also checked the Wiki DOC
ut still have this blank page on the final installation steps when it should write
data into database (which remains empty)
I've also given max permissions 777 to all files and folders and managed with php's
settings as "register globals","error_reporting" and "safe_mode" with no result
I got no apache/mysql errors but only 2 signs from php:
NoticeUndefined index
HTTPS in /home/segretario/htdocs/xoops2073/install/class/settingmanager.php on line 76

on the "General configuration" page
and
Notice: Use of undefined constant XOOPS_ROOT_PATH 
assumed 'XOOPS_ROOT_PATH' in /home/segretario/htdocs/xoops2073/install/index.php on line 258

on the "Saving configuration data.." page.
Hope you can help me figure out these lines and fix the problem.
Thanks in advance,ralf.



45
ralf57
Troubles enabling html in private messages
  • 2004/10/19 14:20

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
i'm having troubles showing html PMs.
I'm refering to the $pm_arr[0]->getVar("msg_text") value.
I mean:the html code is correctly stored into the DB
but it's badly shown when a PM is read.
I guess it depends on the textsanitizer filter,but strangely i haven't found any textsanitizer function in the readpmsg.php file
Hope someone could point me in the right direction...
Thanks in advance,ralf.



46
ralf57
Re: How can i retrieve xoops folder name from XOOPS_ROOT_PATH?
  • 2004/10/5 15:23

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Quote:

Dave_L wrote:
$folder substr(XOOPS_ROOT_PATHstrrpos(XOOPS_ROOT_PATH'/') + 1);


P.S. If this is intended for a module, or code that others would use, it needs to be more general (handle \ as well as /), and maybe should check for errors such as XOOPS_ROOT_PATH having a trailing /.


Thank you Dave,
it works perfectly.



47
ralf57
How can i retrieve xoops folder name from XOOPS_ROOT_PATH?
  • 2004/10/5 14:23

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


Hi all,
on my install i have:
XOOPS_ROOT_PATH >>> /srv/www/htdocs/my_xoops_install
I need to extract "my_xoops_install" from the path
and put it in a variable (ex. $folder).
How can i get it?
Thanks in advance,ralf.



48
ralf57
Re: Removing the Notification Options Block
  • 2004/9/27 13:05

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


I've built an hack to hide the notification options;
download here
Try more than once if you get a broken link.



49
ralf57
Re: Troubles showing the Last 10 News in xoops/admin.php
  • 2004/9/15 15:14

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


@hervet
Thank you for your tips.
I'll make threasure of them.
Quote:
Don't copy/paste code without knowing how it runs


It's by copying and pasting that i have learned all that i know about xoops.
This method works for me...



50
ralf57
Re: Troubles showing the Last 10 News in xoops/admin.php
  • 2004/9/15 12:40

  • ralf57

  • Quite a regular

  • Posts: 231

  • Since: 2003/2/3 1


You're right Mith.
This is the code of last_news.php
//include '../../include/cp_header.php';
include_once XOOPS_ROOT_PATH "/class/xoopstopic.php";
include_once 
XOOPS_ROOT_PATH "/class/xoopslists.php";
include_once 
XOOPS_ROOT_PATH "/modules/news/class/class.newsstory.php";



/*
 * Shows last 10 published stories
 */
function lastStories()
{
    global 
$xoopsDB$xoopsConfig$xoopsModule;
    echo
"odd">";
    echo 
"_AM_LAST10ARTS ""
;
    
$storyarray NewsStory :: getAllPublished1000);
    echo 
"_AM_STORYID "_AM_TITLE "_AM_TOPIC "_AM_POSTER "_AM_PUBLISHED "_AM_EXPIRED "_AM_ACTION "";
    foreach( 
$storyarray as $eachstory )
    {
        
$published formatTimestamp$eachstory -> published() );
        
$expired = ( $eachstory -> expired() > ) ? formatTimestamp$eachstory -> expired() ) : '---';
        
$topic $eachstory -> topic();
        echo 
"
            
$eachstory -> storyid() . "
            XOOPS_URL "/modules/" $xoopsModule -> dirname() . "/article.php?storyid=" $eachstory -> storyid() . "'>" $eachstory -> title() . "
            
$topic -> topic_title() . "
            XOOPS_URL "/userinfo.php?uid=" $eachstory -> uid() . "'>" $eachstory -> uname() . "$published "$expired "XOOPS_URL "/modules/news/admin/index.php?op=edit&storyid=" $eachstory -> storyid() . "'>" _AM_EDIT "-XOOPS_URL "/modules/news/admin/index.php?op=delete&storyid=" $eachstory -> storyid() . "'>" _AM_DELETE "";
        echo 
"n";
    } 
    echo 
"";
    echo 
"
        " 
_AM_STORYID 
        
        
_AM_EDIT "
        
_AM_DELETE "
        
        _AM_GO "' />
        
    

        ";
    echo
"";

 
        
//xoops_cp_header();
        //echo "

" . _AM_CONFIG . "

";
        
include_once XOOPS_ROOT_PATH "/class/module.textsanitizer.php"
        
// $xoopsModule->printAdminMenu();
        // echo "";
        
lastStories();
        echo 
"";
        echo
"odd">";
        echo
"all articvle";
        echo
"";
        
//xoops_cp_footer();

?>


and i placed it in xoops_install/modules/system/ folder.

This file works fine (aexcept for the lang defines)if included in
xoops_install/modules/system/admin.php
with this line:
include XOOPS_ROOT_PATH "/modules/system/last_news.php";


The same file gives me the error reported in my first post
if it's included in
xoops_install/admin.php
Hope i was more clear now and you can help.




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



Login

Who's Online

165 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 165


more...

Donat-O-Meter

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

Latest GitHub Commits