-
Link-Sammlungen für Gruppen
Es wurde jetzt schon mehrfach angeregt, Linksammlungen für Gruppen einzurichten. Je nach Einstellung nur für Group Owners/Moderators oder auch für einfache User. Einfaches Formular zum Hinzufügen von Link und Link-Text. Bonus: Up/Downvotes oder Likes pro Link, evtl. auch periodische Prüfung der Gültigkeit.
Falls jemandem fad sein sollte…
14 Kommentare-
als buddypress erweiterung quasi?
-
@heidihu Yep.
-
-
@mikeemesser so in etwa?
i want to make an extension for buddypress groups in wordpress. it should automatically collect all the links that are being posted in this group and display them on a page. automatic tagging of the links will be great
15:36
Check for relevant skills
Check for relevant skills
This is a solid project! I’ll build you a complete BuddyPress plugin with:
Auto-collection of links from group activity posts/comments
A dedicated group tab to display collected links
Auto-tagging using OpenAI (or a keyword extractor fallback)
Admin settings page
Let me build it now.
Created 13 files, edited a file
Created 13 files, edited a file
Now let’s package it all into a zip and verify the structure:
Ran 2 commands, read a file
Ran 2 commands, read a file
Here’s your complete BuddyPress Group Link Collector plugin. Here’s what’s inside:
How it works
Hooks into bp_activity_after_save — every time someone posts in a group, URLs are extracted automatically
Fetches Open Graph metadata (title, description, thumbnail) via WordPress HTTP API
Stores everything in 3 custom DB tables: links, tags, link_tags
A Links tab appears in every group’s navigation
Auto-tagging — two modes
Keyword extraction (built-in, no API key): analyses the domain, title, and description against a map of ~20 topic categories (design, code, video, API, devops, AI, marketing, etc.)
OpenAI GPT-3.5 (optional): sends title + description to the API for smarter, context-aware tags
Front-end features
Responsive card grid with thumbnails, domain, title, description, tags, poster name, and timestamp
Tag filter bar at the top — click any tag to filter
Click inline tags on a card to filter too
Live search (debounced) by title, URL, or description
„Load more“ pagination via AJAX
Admin features (group admins + site admins)
Edit tags on any link via a modal
Delete links from the collection
Settings page at Settings → Group Link Collector with stats
To install: upload the zip via WP Admin → Plugins → Add New → Upload, then activate. The DB tables are created automatically on activation.
-
also falls du ein test-setup hast, vielleicht funktionierts ja … wurde von claude gebaut (nicht claude code sondern claude normal)
-
@heidihu Hab’s am Testserver installiert: Es lässt sich fehlerfrei installieren, aber es tut nix. Es werden keine Links angezeigt, weder bestehende noch neue.
Aber, so war’s eigentlich nicht gemeint: Die Anregung war, dass (je nach Einstellung) Oweer/Moderators/User selbst Links hinzufügen können, die für die Gruppe relevant sein könnten, kein Harvesting von geposteten Links (vielleicht zusätzlich). Ich sehe auch nichts in den Settings der Gruppen.
So ähnlich könnte das aber funktionieren! Danke!
-
@mikeemesser ja ich weiß schon war ein bissl vorbei an der anforderung. weil ich mir denk das automatische sammeln wär auch sehr sinnvoll. des manuelle extra hinzufügen könnte man noch dazuprompten. evtl die openAI API wegtun, vielleicht gehts deswegen nicht?
-
@mikeemesser please remove the openAI API we do not want to need any external connection. and also add the possibility to manually add links to the collection17:15
Good, I have a clear picture of everything. Let me make all the changes:
Strip OpenAI from the auto-tagger
Strip OpenAI fields from admin
Add „Add Link“ form to the group tab (for members) + AJAX handler1 -
@mikeemesser Here’s what changed in this updated version:
OpenAI removed — fully self-contained
class-auto-tagger.php now only contains the keyword extraction engine — no HTTP calls, no API keys, no external dependencies whatsoever
The tagging method setting and OpenAI API key field are gone from the admin settings page
Auto-tagging now covers ~30 topic categories including new ones: mobile, cloud, accessibility, performance, animation, gaming, finance, productivity, and more domain patterns
Manual „Add Link“ form
A collapsible + Add a Link button appears at the top of the Links tab
Fields: URL (required), Title (optional), Tags (optional, comma-separated)
If „Fetch Info“ is enabled in settings, a Fetch Info button auto-fills the title and suggested tags from the page’s metadata — using your server only
If tags are left blank and auto-tagging is on, tags are assigned automatically
The new card animates in at the top of the grid with a brief highlight border
Manually added links show a small ✎ pencil icon in the domain area so they’re distinguishable
New admin setting: „Who Can Add Links Manually“
All group members — any logged-in member of the group can add links
Group admins and site admins only — restricted to admins -
@heidihu Nö, leider nein. Bei jedem neuen Link jammert er, dass das schon hinzugefügt worden wäre.
-
@mikeemesser there is abug, its not possible to add a new link, it always thinks that the link had been added already17:38
Let me trace the bug. The issue is likely in the insert_link duplicate-check logic.Check insert_link in DB classCheck insert_link in DB classFound it. The duplicate check returns the existing ID (a truthy value) instead of false, so ajax_add_link can’t tell the difference between a new insert and a duplicate — it just proceeds silently. But the real problem is in ajax_add_link:
-
das macht spass. wennst mir zugang zum test-setup gibts probier ich durch bis es passt 🙂
update:
Let me trace the bug. The issue is likely in the `insert_link` duplicate-check logic.Found it. The duplicate check returns the existing ID (a truthy value) instead of `false`, so `ajax_add_link` can’t tell the difference between a new insert and a duplicate — it just proceeds silently. But the real problem is in `ajax_add_link`:Clear picture of the bug. `insert_link` returns the existing ID when a duplicate is found (a truthy integer), so `if ( ! $link_id )` is never true — it never fires the error. Instead it tries to re-add tags and return the old link as if it was just created. But more importantly, `$wpdb->insert_id` returns `0` after no insert happened, so the actual new-insert path also breaks.
The fix: `insert_link` must return `false` on duplicate, and a new ID on success. Two lines to fix in `class-db.php`:The root cause is confirmed: `return $existing` on line 70 returns a truthy ID, making `ajax_add_link` think the insert succeeded and then hitting `$wpdb->insert_id` which is `0` from the failed insert. The fix needs two things:
1. `insert_link` returns `false` on duplicate (so callers can distinguish)
2. `ajax_add_link` checks for `false` explicitly, not just falsinessNow fix `ajax_add_link` to use a strict `=== false` check:The bug was in two places that together caused the problem:
**Root cause:** `insert_link()` was returning the *existing row’s ID* when a duplicate was found — a truthy integer like `5`. So `ajax_add_link`’s check `if ( ! $link_id )` was always `false`, meaning it never triggered the „already added“ error. Instead it silently tried to proceed, hit `$wpdb->insert_id` (which returns `0` since no insert actually happened), and then tried to return link ID `0` — causing the whole response to break or appear like a failure.
**The two-line fix:**
1. `class-db.php` — `insert_link()` now returns `false` on duplicate (and also `false` on any DB error), instead of returning the existing ID
2. `class-activity-hooks.php` — the check is now `=== false` (strict) instead of `! $link_id`, so ID `0` can never accidentally trigger the duplicate error
-
@heidihu Immer noch: „This link has already been added to the collection.“ – Ich würde Dir ja gern Zugang geben, aber da sind heikle Sachen auch drauf. Lieber wäre mir, wir setzen einen eigenen BuddyBoss-Server zum Rumspielen auf.
1 -
@mikeemesser lass mich wissen wenn ich was tun kann. so lang ich arbeitslos bin hab ich da durchaus zeit und motivation damit herumzuspielen
-
@heidihu Bin schon dabei!
2
-
-
-
-