displaying a list in php plugin

Goldo911

Member
hello for some reason I need to create a php plug-in linked to a button that retrieves different items from a list and merges them in an email. I know the email plug-in can do it, but I cannot let my users select all lines from the list and mailt them, I need a 'more integrated way'

I have managed to retrieve properly my list data with the following usefull code from the Wiki:

$listModel = JModelLegacy::getInstance('List', 'FabrikFEModel');

$listModel->setId(4);

$data = $listModel->getData();

But if in php I do a stupid print_r fine, I see all the structure of the array and I know that I've got what I need, but tht does not give me a very sexy display.

=> is there any simple method in php that I can use to integrate my list into my e-mail as it would display on the web site straight ?

That would help me not to reinvent the Wheel browsing through the array and using my custom style -)

THANX A LOT
 
Well, did not get a lot of traction. So I have browsed through the array and displayed my list my own way. I have other issues with e-mail ist plugin but will open another topic for thato_O
 
Not sure I get you completely, however all the elements I have used so far are capable of processing php. Example: All my form components are populated via php and a database like below.

Code:
$options[] = JHTML::_('select.option', ' ', ' ' );
$db = JFactory::getDbo();
$db->setQuery('SELECT id,vencatname FROM jos_fab_ven_categories WHERE id BETWEEN 101 AND 110');
$rows = $db -> loadObjectList();
foreach ($rows as $row) {
    $options[] = JHTML::_('select.option', $row->id, $row->vencatname);
}
return $options;

Right or wrong it works ;)
It could just as easily be a button, checkbox, dropdown, etc...
 
okay thanks for the info, what I missed was this last loop and return semantics -) Will give it a try.

Doing this because my damned list email plugin does not want to send list data, only blank email
 
hello gentlemen,

@ Mr Greg, when I use the list plugin I really try to use it in the most simple way, that is I do setup mail address, I just put a 'test' text in mail body, no php, no whatever. In my opinion - but I amright - the plugin should be able to send the list data if I select a single row or if I select more, but when I click on the mail icon,the mail pop up appars, it mentions 1
or 2 or more items to send depending how many I've checked, then I do send, and then I receive the email properly but only with the test text and the ist data is no where to be found. I think either I have nt understood something very simple, either I am hitting a bug somehow

Paul: sorry if I am stupid - can be ;) - but what do you mean with content Template. So far I leave most list plugin settings @ default values and just add a test text in email content, coz I experienced that if that is empty e-mail will not be sent properly.

Thx to the both of you
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top