Members: 10,140
Threads: 38,830
Posts: 159,367
Online: 40

Newest Member: Xoote



Go Back   Mambers.com > Development > Component Development

Reply
 
Thread Tools Display Modes
Old 19.09.2006, 07:45   #1
yannoushfr
Baby Mamber
 
Join Date: Jul 2006
Posts: 3
yannoushfr is on a distinguished road
Default little problem to get the parameters from url

Hi


I have an issue regarding the parameters from the url.
I am starting to understand how a component works but I can t figure it out why this is not working:

I have a component with 2 options: view_list (which list all the items) and show_item (which show a single item)

in my dailymessage.php I have a switch for the choice. this switch depends on the condition: task in the url:
Quote:
$task = mosGetParam( $_REQUEST, 'task');

switch ($task) {
case 'view':
default:
view_list();
break;
case 'show':

show_item();
break;
}

function view_list(){
global $database;
$database->setQuery("SELECT * FROM #__joe_dailymessage WHERE published = '1'");
$rows = $database->loadObjectList();
dailymessage_HTML::view_list_html($rows);
}


function show_item(){
global $database;
$iditem = mosGetParam($_REQUEST, 'iditem');
$database->setQuery("SELECT * FROM #__joe_dailymessage" . "WHERE id='.$iditem.' AND published = '1'");

$rows = $database->loadObjectList();


dailymessage_HTML::show_item_html($rows);
}
If I do things the way I think, when the component is started, the function view_list will be started (cause no task). in my list I created a link for each item:
Quote:
<td class="more_details"><a href="index.php?option=com_dailymessage&task=show& iditem=<?php echo $row->id;?>">More Details &gt;&gt;</a></td>
when clicking on this link the url will be with task=show. so the show_item should start... but it doesnt..

when I do an echo $task; that give me 0... so I guess ny mosGetparam is not working.

My second problem will be that: when clicking on the link "more detail" the page that is shown, is displayed in the default template. is it possible to display the pages with the parent template? because it is a component I cant assign it from the admin mode.





Any hints
please?

Yann
yannoushfr is offline   Reply With Quote
Sponsored Links
Old 11.07.2008, 05:24   #2
xuanlu425
Baby Mamber
 
Join Date: Jun 2008
Posts: 5
xuanlu425 is on a distinguished road
Arrow Angelling

Very good, hoped that writes a better article, here aoc gold want to propose that some my view, hoped the author holds reader's point of view, take them as the starting point, found the new breach, stood looks at the question in Age of Conan gold standpoint, like this will have is better, more real ffxi gil.
__________________
wow gold
xuanlu425 is offline   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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Another mambo and SSl problem... intelligen Mambo 4.5.1 'How Do I' Questions 0 31.08.2005 19:26
Passing parameters from menu item Benta Mambo 4.5.1 'How Do I' Questions 4 02.06.2005 10:09
Mambo install problem or host problem? joflow Mambo 4.5.1 General Talk 6 03.02.2005 13:30
Problem with parameters in Content Blog Section/Category VicentGiner Mambo 4.5 Bugs 2 08.01.2005 21:32
Titles problem Simbad Mambo 4.5.1 'How Do I' Questions 2 30.12.2004 14:43


All times are GMT +2. The time now is 15:01.

Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.