I'm stuck

lopezio 09 Jun, 2011
Hi friends
Please see what I want. Please look at
http://w3s.brotero.com/index.php?option=com_content&view=category&id=2&Itemid=18

There are program challanges and I need to choose a program and allow the user to send a solution (is done with Chronoforms because I get the id of the article and save it in a database as you can see in problema field) The problem is How can I filter my Chrono connectivity to show only the solutions and not all the solutions? The problem is that the filter depends the Id of the joomla article.
Any solution?
GreyHead 09 Jun, 2011
Hi lopezio,

You can use the WHERE box to filter the results . . . but what is the relationship between the article id and the results you want to show? What logic can you use?

Bob
lopezio 09 Jun, 2011
The article Id is the key I want to filter in my table
In article 5 I want to see all the solutions wich f_problema=5.
GreyHead 09 Jun, 2011
Hi lopezio,

Please try
<?php
$where = array();
$article_id = JRequest::getInt('id', '', 'get');
if ( $article_id ) {
  $where[] = "`f_problema` = '{$article_id}'";
}
$filter = JRequest::getString('filter', '', 'post');
if ( $filter ) {
  // this should be the filter you ae using now.
  $where[] = "`xxx` LIKE '%{$article_id}%'";
}
if ( count($where) ) {
  echo ' WHERE '.implode(' AND ', $where);
}
?>

This should work on an article page but the link you posted is a category list page and the code would need adjusting to work with a category.

Bob
This topic is locked and no more replies can be posted.