populate a fieldlist with joomla articles title

  • Posts: 20
  • Thank you received: 0

greg.o replied the topic: populate a fieldlist with joomla articles title

Oupss "I have changed in the language substitutions. It does not work." =
"I have changed in the language overrides. It does not work."

I use language overrides for change format date ex: DATE_FORMAT_LC2 value : l j F Y

I thought I could do it with your script too. But no;-)

I'll see your links! Thank you very much!!!!
#235154
  • Posts: 2246
  • Karma: 77
  • Thank you received: 298

mihaela replied the topic: populate a fieldlist with joomla articles title

Hello again,

I hope that you will manage to do it using examples from the links.

Let me know the result then.

Regards,

Mihaela
#235172
The following user(s) said Thank You: greg.o
  • Posts: 20
  • Thank you received: 0

greg.o replied the topic: populate a fieldlist with joomla articles title

Hello Mihaela,

I spent hours trying to find the solution. I don't understand much about scripting. I've done a lot of experiments, but nothing's going to work: -/

If you could help me, if it's not too complicated, of course!

You are a great help!!! Thank you very much for your support!
#235220
  • Posts: 2246
  • Karma: 77
  • Thank you received: 298

mihaela replied the topic: populate a fieldlist with joomla articles title

Hello again,

Thank you for your kind words.

I will try to help you with this then.

By default, the "created" date collected from the database is in format Y-m-d H:i:s .

In which format would you like it to display?

Regards,

Mihaela
#235228
The following user(s) said Thank You: greg.o
  • Posts: 20
  • Thank you received: 0

greg.o replied the topic: populate a fieldlist with joomla articles title

I would like the format "l d F Y" if the result (days and months) is in the default language of the site (deutch, french, another)

If not, just "d.m.Y" simply.

Thank you very much!!!!! You're really very kind!
#235231
  • Posts: 2246
  • Karma: 77
  • Thank you received: 298

mihaela replied the topic: populate a fieldlist with joomla articles title

Hello again,

The solution for this turns out to be quite simple.

This code to display the date in "l d F Y" format is the following, but I assume it will be displayed in English.
$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();
$db->setQuery('Select title, created From #__content Where catid=2 OR catid=3 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("l d F Y", strtotime($tmpDate));
    $test .= "0;".$result[$i]['title']. " ".$newDate .";".$result[$i]."\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('SELECTLISTNAME', $test);
NOTE: Once again in the code don't forget to replace SELECTLISTNAME with the name of your select list.

To display the date in format "d.m.Y" just replace in the code above this line of code:
$newDate = date("l d F Y", strtotime($tmpDate));
with this one:
$newDate = date("d.m.Y.", strtotime($tmpDate));

I hope that this will work out as you wanted. :)
Let me know whether it does.

Regards,

Mihaela
#235237
The following user(s) said Thank You: greg.o
Moderators: ForumSupporttomeperica
Time to create page: 0.072 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here