64 lines
3.9 KiB
PHP
64 lines
3.9 KiB
PHP
<?php
|
|
|
|
function get_custom_feed_posts(){
|
|
$if_query = "main_collection_id IS NOT NULL AND main_mandant_id = ".$GLOBALS['main_contact']['current_mandant_id'];
|
|
$query = "SELECT main_collection.* FROM main_collection LEFT JOIN main_collection_mandant_link ON main_collection.id = main_collection_mandant_link.main_collection_id WHERE ((".$if_query.") OR main_collection_id IS NULL) AND main_collection_setup_id = 3 AND (main_collection.is_archived = 0 OR main_collection.is_archived IS NULL) ORDER BY sorting";
|
|
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
|
while($posts = @mysqli_fetch_array($result)) {
|
|
$query2 = "SELECT * FROM main_collection_read WHERE main_collection_id = ".$posts['id']. " AND main_contact_id = ".$GLOBALS['main_contact']['id'];
|
|
$result2 = @mysqli_query($GLOBALS['mysql_con'], $query2);
|
|
if (@mysqli_num_rows($result2) == 1) {
|
|
$read = @mysqli_fetch_array($result2);
|
|
$read_date = new DateTime();
|
|
$read_date = $read_date->format('d.m.Y');
|
|
$state = "gelesen";
|
|
}else{
|
|
$read_date = "--.--.----";
|
|
$state = "ungelesen";
|
|
}
|
|
?>
|
|
<tr>
|
|
<td><?= $posts['description'] ?></td>
|
|
<td><?= get_category_from_post($posts['id']) ?></td>
|
|
<td><?= $read_date ?></td>
|
|
<td class="<?= $state ?>"><span><?= $state ?></span></td>
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
|
|
function get_category_from_post($post_id){
|
|
$query = "SELECT knowledgecenter_category.* FROM knowledgecenter_category LEFT JOIN knowledgecenter_collection_link ON knowledgecenter_collection_link.knowledgecenter_category_id = knowledgecenter_category.id WHERE main_collection_id = ".$post_id;
|
|
$result = @mysqli_query($GLOBALS['mysql_con'], $query);
|
|
$row = @mysqli_fetch_array($result);
|
|
return $row['description'];
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<div class="kc_custom_feed">
|
|
<div class="headline">
|
|
<div class="headline_with_subtitle">
|
|
<h2>AWO Wiki</h2>
|
|
<p>Ansicht: Mein Feed</p>
|
|
</div>
|
|
<div class="svg_content">
|
|
<svg id="network-globe-line" xmlns="http://www.w3.org/2000/svg" width="17.465" height="17.461" viewBox="0 0 17.465 17.461">
|
|
<path id="Pfad_37" data-name="Pfad 37" d="M12.48,2a8.73,8.73,0,0,0-8.73,8.73,5.243,5.243,0,0,0,.044.829A8.73,8.73,0,1,0,12.48,2Zm0,1.247a7.483,7.483,0,0,1,5.263,2.17v.624a11.543,11.543,0,0,0-7.6.031,1.453,1.453,0,0,0-.711-.38H9.275c-.075-.262-.143-.524-.2-.792s-.087-.505-.118-.761a7.433,7.433,0,0,1,3.523-.892ZM10.61,6.908a10.6,10.6,0,0,1,6.966.081,10.539,10.539,0,0,1-1.939,4.365,1.422,1.422,0,0,0-1.609.355,5.585,5.585,0,0,1-.624-.393,9.978,9.978,0,0,1-3.074-3.261,1.4,1.4,0,0,0,.293-1.1ZM8.115,4.663a2.212,2.212,0,0,0,.062.4c.056.274.131.543.206.811a1.422,1.422,0,0,0-.686,1.4A11.424,11.424,0,0,0,5.091,9.62,7.483,7.483,0,0,1,8.121,4.663Zm0,9.8a1.459,1.459,0,0,0-.967,1.1h-.4A7.446,7.446,0,0,1,5.028,11.3l.069-.118a10.539,10.539,0,0,1,3-3.049,1.441,1.441,0,0,0,1.422.393,10.932,10.932,0,0,0,3.336,3.523c.256.168.518.324.78.474a1.447,1.447,0,0,0,.112.7A10.564,10.564,0,0,1,9.88,15.164a1.459,1.459,0,0,0-1.759-.692ZM12.48,18.2a7.433,7.433,0,0,1-3.623-.942l.175-.037a1.459,1.459,0,0,0,.979-1.116,11.493,11.493,0,0,0,4.365-2.183,1.428,1.428,0,0,0,1.871-.387,10.857,10.857,0,0,0,2.694.349h.331a7.483,7.483,0,0,1-6.791,4.328Zm4.06-5.55a1.453,1.453,0,0,0-.206-.742,11.474,11.474,0,0,0,2.114-4.6q.468.218.923.486a7.483,7.483,0,0,1,.262,5.114,9.978,9.978,0,0,1-3.087-.243Z" transform="translate(-3.75 -2)" fill="#e00304"/>
|
|
</svg>
|
|
|
|
</div>
|
|
</div>
|
|
<div class='kc_custom_feed_table'>
|
|
<table>
|
|
<tr class="sticky_tr">
|
|
<th>Beitrag</th>
|
|
<th>Kategorie</th>
|
|
<th>Gelesen am</th>
|
|
<th class="state">Status</th>
|
|
</tr>
|
|
<?php get_custom_feed_posts();?>
|
|
</table>
|
|
</div>
|
|
</div>
|