• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

[Solved] To limit the size of the calc element

georgie

Member
Hi

I use a calc element to display informations dynamically, perfect!
But sometimes this information are so long in size that my forms bug.

I use a CSS "overflow" in lists, it is OK. But not in forms.
I have tried to apply a SQL limit in my query ("limit 0,5", in the code of the calc element), but I can not.

Can you help me?

Here my calc code:
Code:
// Declaration de la variable stockant l id d'origine
$customer_email = '{customer___email_raw}';

// if-else de gestion des cas vides - pour eviter de declencer une requete WHERE vide
if (!empty($customer_email)) {

// Acces a la base de donnees
$myDb = FabrikWorker::getDbo(false, 1);

// Creation requete - argument true pour nettoyer une eventuelle ancienne requete
$myQuery = $myDb->getQuery(true);

// Requete de recuperation de la valeur concernee en fonction de l id d'origine
$myQuery->select("group_concat(concat('<a href=\"',joo_acymailing_url.url,'\" target=\"_blank\">',date_format(from_unixtime(joo_acymailing_urlclick.date),'%d/%m/%Y'),'</a>') order by joo_acymailing_urlclick.date desc)")

->from('joo_acymailing_url inner join joo_acymailing_urlclick on joo_acymailing_url.urlid = joo_acymailing_urlclick.urlid inner join joo_acymailing_subscriber on joo_acymailing_urlclick.subid = joo_acymailing_subscriber.subid')

->where('joo_acymailing_subscriber.email = ' . $myDb->quote($customer_email));


$myDb->setQuery($myQuery);
$ClicHistory = $myDb->loadResult();

// Calcul
return $ClicHistory ;
}

// If empty
else {
return '';
}

THX
 
Hi

It seems I can not use a "setLimit" , maybe because sub-queries... It does not work.

I think it is when my calc element display manys links, it is very strange. You can see it here for example:
https://euromedicom.org/emc-v2/form/226/52608

With "fabrik_9854rtgyhjFGHJ" in ID and PWD.

Please look the field "Clics history", Its links go over the rest of the page.
 
I can't see it in your custom_css.php

Better remove the access infos from your post.
 
No, because the rest of the page above contain link, try to fill a field above for example (please do not save).
 
The MySQL limit clause applies to the final result set, not the number of rows used to construct the group concat. Your query only returns one row.

You'll have to use a sub query with a limit, and an outer query that applies the group concat to those results.


Sent from my HTC 10 using Tapatalk
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top