Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Modification to the way that trimlen works with URLs

phpMyEdit Features     Modification to the way that trimlen works with URLs
Post new topic   Reply to topic    
 
ajh     Joined: 17 Dec 2003   Posts: 236  
Post Posted: 2003-12-17 17:50
Back to top  Reply with quote     

The problem I have with trimlen is that it trims the field before the value is passed to the URLdisplay routine. So if you want the URL to be trimmed on screen, but to be linked to the full URL, you can't.

I've made a small change to the cellDisplay function to create a new variable $fullvalue which is set before trimlen is run as follows:
Code:
$fullvalue = $value;
if (intval($this->fdd[$k]['trimlen']) > 0 && strlen($value) > $this->fdd[$k]['trimlen']) {
   $value = ereg_replace("[\r\n\t ]+",' ',$value);
   $value = substr($value, 0, $this->fdd[$k]['trimlen'] - 3).'...';
}


This is then passed to URLDisplay as an extra parameter:
Code:
if ($this->col_has_URL($k)) {
   return $this->urlDisplay($k, $value, $fullvalue, $css, $key_rec);
}


URLdisplay itself just needs the extra parameter added:
Code:
function urlDisplay($k, $value, $fullvalue, $css, $key)


You now have an extra variable that you can use in the URL and URLdisp options. $value gives you the trimmed url to use in URLdisp, $fullvalue gives you full url to use in URL

Is this something that we could see in the next release?

 
nepto     Joined: 06 Jan 2003   Posts: 381   Location: Phoenix, Arizona (USA)
Post Posted: 2003-12-18 22:15
Back to top  Reply with quote     

Thank you for this nice bug-report.

It was fixed in the CVS and will appear in comming release.

http://opensource.platon.sk/projects/bug_view_advanced_page.php?f_bug_id=150

_________________
Ondrej Jombik (Nepto)
Visit my homepage , review my recent CV or projects and give me some feedback .
 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy