I have listed some code I m working on that works well
basically it pulls some data off a database and limits it to displaying 250 characters of the description which if the user clicks on the ..more link it will pass the variable onto a new page and show them the whole description if it is larger that 250 chars.
Im trying to get this data dispalyed to a popup window and what ever I try Im getting un expected Tstring errors the
change needs to be made in the $s4 variable but i cant get it to work I have tried things like this for example just to even see if I can use a popup without even trying to pass the $GLOBAL[''];
example of what i tried
$s4 = '<a href="javascript: window.open('file.php', 'window_name', 'width = 50, height = 50')">..More</a>';
This is giving me T_String errors
below is the code Im using currently .
If some one can help me make $s4 a popup I would really apreciate it .
Thanks again
Code :
=========================================================
<?php
function nicetrim ($s) {
$MAX_LENGTH = 250;
$Str = html_entity_decode($s);
if (strlen($Str) <= $MAX_LENGTH) {
return $s;
}
$s2 = substr($Str, 0, $MAX_LENGTH - 3);
$s3 = '......';
$s4 = '<a href="['description'].'" ><font color="#000000">
More</font></a>';
return htmlentities($s2).$s3.$s4;
}
?>
// this works and is called in the html like so
<div align="left">'.nicetrim ($description).'
</div>
//to make it a popup is what i need
=============================================
Thanks
basically it pulls some data off a database and limits it to displaying 250 characters of the description which if the user clicks on the ..more link it will pass the variable onto a new page and show them the whole description if it is larger that 250 chars.
Im trying to get this data dispalyed to a popup window and what ever I try Im getting un expected Tstring errors the
change needs to be made in the $s4 variable but i cant get it to work I have tried things like this for example just to even see if I can use a popup without even trying to pass the $GLOBAL[''];
example of what i tried
$s4 = '<a href="javascript: window.open('file.php', 'window_name', 'width = 50, height = 50')">..More</a>';
This is giving me T_String errors
below is the code Im using currently .
If some one can help me make $s4 a popup I would really apreciate it .
Thanks again
Code :
=========================================================
<?php
function nicetrim ($s) {
$MAX_LENGTH = 250;
$Str = html_entity_decode($s);
if (strlen($Str) <= $MAX_LENGTH) {
return $s;
}
$s2 = substr($Str, 0, $MAX_LENGTH - 3);
$s3 = '......';
$s4 = '<a href="['description'].'" ><font color="#000000">
More</font></a>';
return htmlentities($s2).$s3.$s4;
}
?>
// this works and is called in the html like so
<div align="left">'.nicetrim ($description).'
</div>
//to make it a popup is what i need
=============================================
Thanks