TOPIC:

populate a fieldlist with joomla articles title 2 years 1 month ago #235951

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello again,

I'm glad that you have managed to find the solution, good job! :)

Best regards,

Mihaela

Please Log in or Create an account to join the conversation.

populate a fieldlist with joomla articles title 1 month 3 weeks ago #258119

  • greg.o
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 49
  • Thanks: 0
Hello,

I'm coming back with this code. It does not work anymore. The titles are no longer displayed in the form. I don't know since when. The site was in standby for some time. :unsure:

Has something changed so that this script does not work anymore?

Thanks for your support!

$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();
$db->setQuery('Select title, created From #__content Where catid=9 AND state =1'); 

$result = $db->loadAssocList(); //load the result from the query
$test = "";
for ($i = 0; $i < count($result); $i++)
{
    $tmpDate = $result[$i]['created'];
    $newDate = date("d.m.Y", strtotime($tmpDate));
    $test .= "0;".$result[$i]['title']. " le ".$newDate.";".$result[$i]['title']."\n";
}
 
function ff_setSelectList($name, $value)
{
     global $ff_processor;
     for ($r = 0; $r < $ff_processor->rowcount; $r++)
     {
          $row =& $ff_processor->rows[$r];
          if ($row->name==$name)
          $row->data2 = $value;
          unset($row);
     } // for
} // ff_setSelectList
ff_setSelectList('listeEvenements', $test);

Please Log in or Create an account to join the conversation.

populate a fieldlist with joomla articles title 1 month 3 weeks ago #258120

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

please try to use:
$result = $db->loadResult();
instead of
$result = $db->loadAssocList(); 

The whole code looks like:
$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();
$db->setQuery('Select title, created From #__content Where catid=9 AND state =1'); 

$result = $db->loadResult(); //load the result from the query
$test = "";
for ($i = 0; $i < count($result); $i++)
{
    $tmpDate = $result[$i]['created'];
    $newDate = date("d.m.Y", strtotime($tmpDate));
    $test .= "0;".$result[$i]['title']. " le ".$newDate.";".$result[$i]['title']."\n";
}
 
function ff_setSelectList($name, $value)
{
     global $ff_processor;
     for ($r = 0; $r < $ff_processor->rowcount; $r++)
     {
          $row =& $ff_processor->rows[$r];
          if ($row->name==$name)
          $row->data2 = $value;
          unset($row);
     } // for
} // ff_setSelectList
ff_setSelectList('listeEvenements', $test);

Regards,
Tihana
The following user(s) said Thank You: greg.o

Please Log in or Create an account to join the conversation.

populate a fieldlist with joomla articles title 1 month 3 weeks ago #258121

  • greg.o
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 49
  • Thanks: 0
Thanks for your help, but it is not good.

It only shows me the first letter of the title and the date, and still not the other titles.

Can you give me access?

Sorry

Please Log in or Create an account to join the conversation.

populate a fieldlist with joomla articles title 1 month 3 weeks ago #258122

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6086
  • Karma: 3
  • Thanks: 429
Hi,

please check this table in your phpmyadmin(#__content)
Select title, created From #__content Where catid=9 AND state =1
Because this will only show title where catid=9 and state=1

Regards,
Tihana

Please Log in or Create an account to join the conversation.

populate a fieldlist with joomla articles title 1 month 3 weeks ago #258124

  • greg.o
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 49
  • Thanks: 0
Thank you for your help, the problem comes from multi categories. The choice must be first on the category 9. Thanks to you and Phpmyadmin it's ok.

Thank you very much for your precious collaboration!

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.044 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!