I've started work on creating a contributers.php file (seen in commit 1818bb3377e639d7b17be4538fd8b0b528eb2fd2 ). To do this, I've created a function: create_contributer_list() that lists all of the contributers to the site with an optional search term. It looks like this
/**
* Generates HTML for a list of contributers with an optional search term.
*
* @param string $searchTerm
* @return string
*/
function create_contributer_list($searchTerm = "") {
global $db;
$output = '';
if($searchTerm === '') {
$sql = "select username, fullName, imguri from contributers;";
$results = $db->prepare($sql);
$results->execute();
} else {
$sql = "select username, fullName, imguri from contributers where username like '%?%' or fullName like '%?%';";
$results = $db->prepare($sql);
$results->execute([$searchTerm,$searchTerm]);
}
if($results->rowCount) {
$output = $output.'<table class="contributer-list">';
while($row = $results->fetchObject()) {
$output = $output.'<tr><td>';
if($row->imguri == NULL) {
$output = $output.'</td>';
} else {
$output = $output.'<image src="'.$row->imguri.'" class="profile-img-small"></td>';
}
$output = $output.
'<td>'.
$row->username.
'</td><td>';
if($row->fullName == NULL) {
$output = $output.'</td>';
} else {
$output = $output.$row->fullName.'</td>';
}
$output = $output.'</tr>';
}
$output = $output.'</table>';
} else {
£$output = '<h3>No Results Match Your Search</h3><p>Woops, we couldn\'t find any contributers matching your search term. Please try again with a different search term, or remove your search completely.</p>';
}
return $output;
}
This function was introduced in commit bca9a0ebf15e0ad0f2af4d0d406639a22f9fb7d1 . Problem is ... I have no idea where the error is!
I've started work on creating a contributers.php file (seen in commit 1818bb3377e639d7b17be4538fd8b0b528eb2fd2 ). To do this, I've created a function: create_contributer_list() that lists all of the contributers to the site with an optional search term. It looks like this
This function was introduced in commit bca9a0ebf15e0ad0f2af4d0d406639a22f9fb7d1 . Problem is ... I have no idea where the error is!
Any help would be appreciated
Mikey