validated adminpanel, added shown friends limit in profile.

This commit is contained in:
Hendrik
2017-02-03 11:14:03 +01:00
parent bb352c7a7a
commit da061de226
2 changed files with 22 additions and 9 deletions

View File

@@ -126,11 +126,11 @@ if (isset($_GET["groupstatus"])) {
if ($userinfo == 'owner') {
echo "<button type=\"submit\"
name=\"batchactions\"
id=\"admin\"
id=\"batch-admin\"
value=\"admin\">Maak Admin</button>
<button type=\"submit\"
name=\"batchactions\"
id=\"owner\"
id=\"batch-owner\"
value=\"owner\">Maak Eigenaar</button>";
}
?>
@@ -139,9 +139,9 @@ if (isset($_GET["groupstatus"])) {
onsubmit="adminUpdate(this); return false;">
<input type="hidden" name="groupbatchactions" id="groupbatchinput">
<button type="submit" name="batchactions" id="hide" value="hidden">Verborgen</button>
<button type="submit" name="batchactions" id="ban" value="public">Publiek</button>
<button type="submit" name="batchactions" id="members" value="membersonly">Alleen Leden</button>
<button type="submit" name="batchactions" id="batch-hide" value="hidden">Verborgen</button>
<button type="submit" name="batchactions" id="batch-public" value="public">Publiek</button>
<button type="submit" name="batchactions" id="batch-members" value="membersonly">Alleen Leden</button>
</form>
</div>
@@ -151,5 +151,3 @@ if (isset($_GET["groupstatus"])) {
</div>
</div>
</div>
</body>
</html>

View File

@@ -55,10 +55,17 @@
<h3>Vrienden</h3>
<p>
<?php
while($friend = $profile_friends->fetch()) {
$friendcount = $profile_friends->rowCount();
$frienddif = $friendcount - 7;
for ($i = 0; $i < min($friendcount, 7); $i += 1) {
$friend = $profile_friends->fetch();
echo "<a href='profile.php?username=${friend["username"]}' data-title='${friend["username"]}'><img class='profile-picture' height='42' width='42' src='${friend["profilepicture"]}' alt='${friend["username"]}' /></a>";
}
if ($frienddif > 0) {
echo $frienddif === 1 ? "en nog 1 andere." : "...en nog $frienddif anderen.";
}
if($profile_friends->rowCount() === 0) {
echo "<p>Deze gebruiker heeft nog geen vrienden gemaakt.</p>";
@@ -71,10 +78,18 @@
<h3>Groepen</h3>
<p>
<?php
while($group = $profile_groups->fetch()) {
$groupcount = $profile_groups->rowCount();
$groupdif = $groupcount - 7;
for ($i = 0; $i < min($groupcount, 7); $i += 1) {
$group = $profile_groups->fetch();
echo "<a href='group.php?groupname=${group['name']}' data-title='${group["name"]}'><img class='group-picture' src='${group["picture"]}' alt='${group["name"]}s logo'></a>";
}
if ($groupdif > 0) {
echo $groupdif === 1 ? "en nog 1 andere." : "...en nog $groupdif anderen.";
}
if($profile_groups->rowCount() === 0) {
echo "<p>Deze gebruiker is nog geen lid van een groep.</p>";
}