close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Results Page limit data

Thread began 10/21/2009 1:39 pm by njewett222247 | Last modified 10/24/2009 3:16 pm by anonymous | 1418 views | 8 replies |

njewett222247

Results Page limit data

On a results page, I need to limit the number of charaters in a given filed. if I spesify a text field it reurns all the text in that field, which I would want on a detail page. But in a results page, I just want say the first 30 characters so the list is manageable.

In the attached image body_bb displays everything in a record field, I just ant the first thirty charaxters!

Nick

Sign in to reply to this post

Jason ByrnesWebAssist

use the php substr() function to return only the first 30 charters of the recordset column:

<?php echo substr($row_rsName['column'], 0, 30); ?>


see the following for more on the substr() function:
substr

Sign in to reply to this post

njewett222247

Thanks!

Thanks, I'll try that, buy the way, if there is an image embedded in the text it shows full size, any ideas on how to force it to use a thumbnail?

Nick

Sign in to reply to this post

Jason ByrnesWebAssist

Add a width or height attribute to the image tag:

<img src="image.jpg" height="30" width="30" border="0" />

Sign in to reply to this post

nickj

Image size

I was hoppeing to use auto-thumbnails so the load time was reduced.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

You would need to convert the image to a thumbnail when it;s uploaded.

You can do this using Digital File Pro.

Sign in to reply to this post

nickj

Thumbnails

I send a post titled Failed recordset this morning which shows my lack of success at using DFP. If the recordset fails DFP can't be inserted into the page because the upload behavior can't get the server file name.

I also am used to using images in different sizes in different locations. Interaktonline's show thumnail feature produced a thumbnail the first time the page is accessed and from then on the page loads the saved thumbnail.

Nick

Sign in to reply to this post

roger391472

excerpt code

Hey maybe I finally get to help someone instead of begging for help.

Nick, here's an excerpt code that works really good. It goes to the last complete word so you don't end up with any embarrassing incomplete words.

LOL Don't expect this of me often though, a guy wrote this for me and I just manged to apply it to another page I was working on...probably just lucky.

<?php function excerpt($message,$size = 150){
$message = substr($message,0,$size);
$point = strrpos($message,' ');
$message = substr($message,0,$point);

return $message.' ...';
}
?>
<?php do { ?>
<tr class="<?php echo $WARRT_AltClass1->getClass(true); ?>" >
<td><div id="new_prod_image"><img src="new_prod_thumb/<?php echo $row_rs_tech_index['prod_thumb1']; ?>" width="120" height="80" border="0"></div>
<div id="new_prod_title"><?php echo $row_rs_tech_index['new_prod_title']; ?></div>
<br />
<div id="new_prod_article"><?=excerpt($row_rs_tech_index['new_prod_article']); ?></div></td>

You'll need to add the function called "excerpt" at the top of the code as shown and change your echo line as shown in the bottom line of this code.

Roger

Sign in to reply to this post

anonymous

Roger...

Thanks a bunch... it helped me too, I was looking for a function like this to add to my arsenal. I have tried several other techniques that I wasn't really enamored with, so I will give this one a go!

Best regards,

Brian

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...