Re:how to add link to dynamic truncated text (1 viewing) (1) Guests
how to add link to dynamic truncated text
by jahflasher 1 Year ago
i have this code that truncate a value passed to it if the text is greater than a certain number. What i want now is to be able to dynamically add a ink to the truncate symbol ... so that users can click on that more details. this is the _script_.

$comment = $row_rsMyp_com['comment_com'];
$output = substr($comment, 0, 75) ;
echo $output .= "...";

I want to now add a _link_ to the ... so that users can view all the message. Any help is appreciated.
Last Edit: 10/29/2007 09:05pm By jahflasher.
The administrator has disabled public write access. | Report to moderator   Logged Logged  
Re:how to add link to dynamic truncated text
by cyberpunk 1 Year ago
ahh.. but thats a ssimple as adding an href to the "..." and _link_ing it to a page that displays the entire comment
Code: :

  $comment "full text no concatenation at all"; echo $ouput."..." on fullcomment.php yould just echo $comment which has the... full comment.

Last Edit: 10/30/2007 09:33pm By cyberpunk. Reason: added code tags
The administrator has disabled public write access. | Report to moderator   Logged Logged  
Re:how to add link to dynamic truncated text
by jahflasher 1 Year ago
it sounds easy but i am getting error when i try to output the _link_ on the ..., look what i did:

echo $output .= "a href="test.php".../a"; ie: i deleted the greater than and less than signs from this because the forum strips the whole _link_ from the data_base_.

Any idea where i am going wrong.

note. it seems like this forum software auto strip any kind of _script_s. I cant get the forum to save php _link_ i have placed in the $output variable.
Last Edit: 10/30/2007 11:21pm By jahflasher.
The administrator has disabled public write access. | Report to moderator   Logged Logged  
Re:how to add link to dynamic truncated text
by cyberpunk 1 Year ago
Could yo up please post the error you get? cause i'm not able to figure out what is causing your error. and secondly. Sorry for the long delay I been in offline mode due to cable and wireless troubles for about 3 weeks. Will look at the stripping problem you pointed out. thanks.

testing if I fixed the flaw.

Code: :

 <a href="test.html">testing</a>

Last Edit: 11/07/2007 02:55am By cyberpunk.
The administrator has disabled public write access. | Report to moderator   Logged Logged  
 
     
Powered by FireBoardget the latest posts directly to your desktop