BUG FIX: username doesn't cut off in link #185

Merged
11291680 merged 1 commits from lars into master 2017-02-02 12:53:14 +01:00
3 changed files with 11 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ foreach($friends as $i => $friend) {
<?= $friend->fullname ?><br/> <?= $friend->fullname ?><br/>
<span style='color: #666'><?php <span style='color: #666'><?php
if (isset($friend->username)) { if (isset($friend->username)) {
echo $friend->username; echo $friend->usernameshort;
} else if (isset($friend->content)) { } else if (isset($friend->content)) {
echo $friend->content; echo $friend->content;
} }

View File

@@ -10,7 +10,8 @@ function selectLimitedFriends($userID, $limit) {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
`userID`, `userID`,
LEFT(`username`, 12) as `username`, LEFT(`username`, 12) as `usernameshort`,
`username`,
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`, LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
IFNULL( IFNULL(
`profilepicture`, `profilepicture`,
@@ -50,7 +51,8 @@ function selectAllFriends($userID) {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
`userID`, `userID`,
LEFT(`username`, 12) as `username`, LEFT(`username`, 12) as `usernameshort`,
`username`,
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`, LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
IFNULL( IFNULL(
`profilepicture`, `profilepicture`,
@@ -85,7 +87,8 @@ function selectAllFriendRequests() {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
`userID`, `userID`,
LEFT(`username`, 12) as `username`, LEFT(`username`, 12) as `usernameshort`,
`username`,
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`, LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
IFNULL( IFNULL(
`profilepicture`, `profilepicture`,
@@ -235,8 +238,8 @@ function searchSomeFriends($n, $m, $search) {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
`userID`, `userID`,
LEFT(`username`, 12) as `usernameshort`,
LEFT(`username`, 12) as `username`, `username`,
LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`, LEFT(CONCAT(`user`.`fname`, ' ', `user`.`lname`), 12) as `fullname`,
IFNULL( IFNULL(
`profilepicture`, `profilepicture`,

View File

@@ -349,7 +349,8 @@ function searchSomeUsers($n, $m, $search) {
$stmt = prepareQuery(" $stmt = prepareQuery("
SELECT SELECT
`userID`, `userID`,
LEFT(`username`, 12) as `username`, LEFT(`username`, 12) as `usernameshort`,
`username`,
IFNULL( IFNULL(
`profilepicture`, `profilepicture`,
'../img/avatar-standard.png' '../img/avatar-standard.png'