Members: 16,996
Threads: 38,845
Posts: 159,389
Online: 13

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 15.02.2005, 22:34   #1 (permalink)
Mamber
 
Xirtam's Avatar
 
Join Date: Apr 2004
Posts: 81
Xirtam is on a distinguished road
Send a message via MSN to Xirtam
Question Modules and a parameter

I have two different modules.
One containing
PHP Code:
$sql "SELECT title_alias, id, sectionid, created, state";
$sql .= " FROM #__content ";
$sql .= "WHERE sectionid = 2 AND state = 1 ";
$sql .= "ORDER BY created ASC";
$database->setQuery($sql);
$database->query();
$events $database->loadObjectList(); 
And one with
PHP Code:
d    $sql "SELECT * FROM #__content "
        
"WHERE (created >= '$selected_date 00:00:00' AND created <= '$selected_date 23:59:59') "
        
"AND (sectionid = 2) "
        
"AND state='1'"
When I want them to look to another sectionid I have the edit them manualy by changing 'sectionid=2' into another value.
I prefer the way an administrator can do : changing the parameter in the modules section as an administrator.

What do I have to change?
I looked into a view tut's but couldn't find anything that helped me.

_X_
__________________
_/ _/ _/ Xirtam
_/ _/ _/ www.ummagumma.nl
_/ _/ _/ Mambo Calendar Modules
Xirtam is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 16.02.2005, 03:11   #2 (permalink)
Professional Mamber
 
zorkhh's Avatar
 
Join Date: Apr 2004
Location: Northern Germany
Posts: 713
zorkhh is on a distinguished road
Default Re: Modules and a parameter

Hi,

just look into the Developer-Doc at mamboserver.com. There you find all you need.

In your Module's XML-File insert a parameter tag like this:

<param name="sectionid" type="mos_section" default="0" label="Section:" description="" />

and in your module's PHP-File you have to read the parameter(s):

global $database, $mainframe;

// Init parameters or set defaults
$MOSSECTIONID=$params->get('sectionid','2');

Greetings, ZorkHH
__________________
News and stories around Joomla! PlanetJoomla.com
For individual Joomla-AddOns visit Joomlaexpert.com
zorkhh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
writing content goatlady Mambo 4.5.1 'How Do I' Questions 9 01.02.2005 01:59
different styling for different modules mamborv Mambo 4.5.1 'How Do I' Questions 2 03.12.2004 14:05
4.5.1RC1 Admin Modules idigital Mambo 4.5.1 Bugs 4 22.10.2004 22:34
Javascript error while administering modules (document.adminForm.task is null or not harshadoak Mambo 4.5.1 Bugs 0 25.08.2004 09:32
New Modules -> Panda Pack setup Development Announcements 6 23.07.2004 18:42


All times are GMT +2. The time now is 08:28.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.