Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter johndoeherty

    (@johndoeherty)

    Hey Ben,

    thanks for your reply. Well, in the meantime I’ve hacked it together – bit sloppy but deadline’s looming ??

    This is how I gat the data I need:

    $psts = query_posts('author='.$user->user_id); // get the authors posts
    $teasr = strip_tags ( $psts[0]->post_content ); // content wo tags
    $titl = strip_tags ( $psts[0]->post_title); // same w titles
    $startPos=0; // just want a short teaser
    $maxLength=75; // so truncate content at whitespace...
    if(strlen($teasr) > $maxLength) {
    	$excerpt   = substr($teasr, $startPos, $maxLength-3);
    	$lastSpace = strrpos($excerpt, ' ');
    	$excerpt   = substr($excerpt, 0, $lastSpace);
    	$excerpt  .= '...';
    } else {
    	$excerpt = $teasr;
    }
    $auth_link = $psts[0]->guid; // link to post

    This is how I parse it out:

    // the continue reading link
    $readon = '';
    $readon .= '<a class="auth_continue" href="'. $auth_link .'">';
    $readon .= '...weiterlesen';
    $readon .= '</a>';
    
    if ($biography) $html .= '<div class="biography">'. $titl .'</div><div class="bio_text">'. $excerpt .'</div>'. $readon .'<div style="clear:both;"></div>';

    And yes, this all goes into lib/Userlist.class.php at around line 265.

    Hope this helps anybody trying to do the same thing!

    Greets
    JD

    johndoeherty

    (@johndoeherty)

    Many torn-out hairs saved…

    TNX!

Viewing 2 replies - 1 through 2 (of 2 total)