// lastpostings 0.4.0 // Hubzilla-Umgebung laden require_once '/var/www/klacker.org/boot.php'; require_once '/var/www/klacker.org/include/bbcode.php'; // Für bbcode() // Kanal-ID und -name ermitteln $channel_id = isset($_SESSION['uid']) ? intval($_SESSION['uid']) : 59; $channel_name = isset($a->channel['channel_name']) ? $a->channel['channel_name'] : 'tutorial01'; // SQL-Abfrage: Nur eigene Postings (item_origin=1) mit mimetype='text/bbcode' $sql = sprintf( "SELECT id, mid, title, body FROM item WHERE uid = %d AND item_origin = 1 AND item_deleted = 0 AND verb IN ('Create', 'Announce') AND mimetype = 'text/bbcode' ORDER BY id DESC LIMIT %d", intval($channel_id), 3 // Anzahl der anzuzeigenden Postings ); $result = q($sql); // Ergebnisse verarbeiten $items = []; if (is_array($result)) { $items = $result; } elseif ($result && property_exists($result, 'num_rows') && $result->num_rows > 0) { while ($item = $result->fetch()) { $items[] = $item; } } // Ausgabe if (!empty($items)) { echo '
' . $summary . '
'; echo $read_more_link; echo 'Keine Beiträge gefunden.
'; }