Archived
1
0

Implement feature for deleting posts and improving ajax requests

This commit is contained in:
Marcel
2018-10-17 13:56:22 +02:00
parent b32b2790c8
commit 334aa22362
23 changed files with 193 additions and 96 deletions

View File

@@ -210,14 +210,13 @@
Bitte erstelle dir entweder
<a href="<?= base_url('login') ?>">kostenlos einen neuen Account</a>
oder
<a href="<?= base_url('login') ?>">melde dich an</a>.
<a href="<?= base_url('login') ?>">melde dich an</a>
.
</div>
<?php
exit;
}
var_dump($this->input->post('postMedia'));
$content = $this->input->post('content');
if (strlen($content) >= 10000) {
?>
@@ -247,23 +246,25 @@
}
$media = $this->input->post('postMedia');
foreach ($media as $entry) {
$image = str_replace(' ', '+', $entry['image']);
$image = substr($image, strpos($image, ',') + 1);
$image = base64_decode($image);
if (!empty($media)) {
foreach ($media as $entry) {
$image = str_replace(' ', '+', $entry['image']);
$image = substr($image, strpos($image, ',') + 1);
$image = base64_decode($image);
$fileUrl = $this->FileModel->uploadFileByContent($image, $entry['name'], $entry['type'], $entry['size']);
$fileUrl = $this->FileModel->uploadFileByContent($image, $entry['name'], $entry['type'], $entry['size']);
$this->PostsModel->addImageToPost($postID, $fileUrl);
$this->PostsModel->addImageToPost($postID, $fileUrl);
}
?>
<div class="alert alert-success" role="alert">
<b>Dein Post wurde erfolgreich veröffentlicht!</b> Möchtest du nun deine Posts ansehen? <br>
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Nein</button>
<a href='<?= base_url('user/' . $_SESSION['user']['username'] . '/posts') ?>' class='btn btn-sm btn-primary'>Ja</a>
</div>
<?php
}
?>
<div class="alert alert-success" role="alert">
<b>Dein Post wurde erfolgreich veröffentlicht!</b> Möchtest du nun deine Posts ansehen? <br>
<button type="button" class="btn btn-sm btn-default" data-dismiss="modal">Nein</button>
<a href='<?= base_url('user/' . $_SESSION['user']['username'] . '/posts') ?>' class='btn btn-sm btn-primary'>Ja</a>
</div>
<?php
}
public function followers($user = "")