Hello out there.

I currently have a vbulletin board up on my site. I already asked at the main site, and everywhere, but no help.

I want the News and Announcements forum, to show up on my index page as the content. Like when an admin posts something in that forum, that post will show up on the main page.

Could this be done in vbulletin?

Thanks,
Artem

Dani AI

Generated

asked how to show the "News and Announcements" forum content on the site index. correctly pointed out vBulletin will not automatically mirror forum threads on an external homepage, and suggested looking at community customization resources. Below are practical, version-agnostic ways to implement this with safe, maintainable code and a short example you can adapt.

A straightforward approach is to pull the latest threads from that forum and render a sanitized excerpt on the homepage. Steps: determine the forum id (check the forum URL — the f= value), decide whether you want thread titles only or first-post excerpts, and only select visible threads. A simple, secure example using PDO:

<?php
// adjust credentials and $forumid
$pdo = new PDO('mysql:host=localhost;dbname=vb_db;charset=utf8mb4','dbuser','dbpass',[
  PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
]);

$forumid = 5; // replace with your forum id
$sql = "SELECT t.threadid, t.title, p.pagetext, t.dateline
        FROM thread AS t
        JOIN post AS p ON p.postid = t.firstpostid
        WHERE t.forumid = :fid AND t.visible = 1
        ORDER BY t.dateline DESC LIMIT 5";
$stmt = $pdo->prepare($sql);
$stmt->execute([':fid'=>$forumid]);

while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
  echo '<h3><a href="/forum/showthread.php?t='.$row['threadid'].'">'.htmlspecialchars($row['title']).'</a></h3>';
  echo '<p>'.nl2br(htmlspecialchars(strip_tags($row['pagetext']))).'</p>';
}
?>

If permissions, BBCode rendering, or attachments matter, include vBulletin’s environment (for example by requiring vBulletin’s global.php) and use its API so output respects user permissions and uses the forum’s BBCode-to-HTML routines. That avoids exposing private posts and preserves censoring/formatting.

Cautions and tips: always sanitize output to prevent XSS, cache results (file or memcache) for a short time to reduce DB load, and avoid hard-coding DB credentials in public files (reuse vBulletin’s config when possible). If the forum holds private content, enforce vBulletin permissions rather than serving raw DB rows.

Recommended Answers

All 2 Replies

vBulletin does not offer this functionality. You will need to get it out of the database yourself to display it on your homepage.

Try asking at or www.vbulletin-faq.com. They are not affiliated with Jelsoft, but the sites are well run.

The "official" site for vbulletin customization is www.vbulletin.org, but I don't recommend it - the signal-to-noise ratio is awful, and the site is managed in a highly unprofessional manner.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.