Skip to Content Skip to Menu

Restrict length of biography on user list

  • tslade
  • tslade
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
13 years 4 months ago #167936 by tslade
Hi guys,

I am using the user list to display all members; name, profile picture, and bio. The bio is rather long on some members page and was wondering how I would restrict the length of this input on the user list but maintain the full bio on their profile???

Cheers.

Please Log in or Create an account to join the conversation.

  • tslade
  • tslade
  • OFFLINE
  • Posts: 5
  • Thanks: 0
  • Karma: 0
13 years 3 months ago #168214 by tslade
I have found the code in the default.php file in the corresponding template, just hoping someone can point me in the right direction. Where would I place the code to restrict the word count (ie .$limit = 50.)

here is the code from the template:
Code:
<?php // table content: $i = 0; if ( is_array( $this->users ) && count( $this->users ) > 0 ) { foreach ( $this->users as $userIdx => $user) { $class = "sectiontableentry" . ( 1 + ( $i % 2 ) ); // evenodd class if ( $this->allow_profilelink ) { $style = "style=\"cursor:hand;cursor:pointer;\""; $style .= " id=\"cbU".$i."\"" ; } else { $style = ""; } if ( $user->banned ) { echo "\t\t<tr class=\"$class\"><td colspan=\"".$colsNbr."\" ><span class=\"error\" style=\"color:red;\">"._UE_BANNEDUSER." ("._UE_VISIBLE_ONLY_MODERATOR.") :</span></td></tr>\n"; } echo "\t\t<tr class=\"$class\" ".$style.">\n"; foreach ( array_keys( $this->columns ) as $colIdx ) { echo "\t\t\t<td valign=\"top\" class=\"cbUserListCol" . $colIdx . "\">" . $this->_getUserListCell( $this->tableContent[$userIdx][$colIdx] ) . "\t\t\t</td>\n"; } echo "\t\t</tr>\n"; $i++; } } else { echo "\t\t<tr class=\"sectiontableentry1\"><td colspan=\"".$colsNbr."\">"._UE_NO_USERS_IN_LIST."</td></tr>\n"; } ?> </tbody> </table> <hr class="cbUserListHrBottom" size="1" /> <?php } function _getUserListCell( &$cellFields ) { $html = array(); foreach ( $cellFields as $fieldView ) { if ( $fieldView->value !== null ) { if ( $fieldView->title ) { $title = '<span class="cbUserListFieldTitle cbUserListFT_' . $fieldView->name . '">' . $fieldView->title . ':' . '</span> '; } else { $title = ''; } $html[] = '<div class="cbUserListFieldLine">' . $title . '<span class="cbListFieldCont cbUserListFC_' . $fieldView->name . '">' . $fieldView->value . '</span>' . '</div>'; } } return "\n\t\t\t\t" . implode( "\n\t\t\t\t", $html ) . "\n"; } } ?>

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum