I want to have a script that will display a 'word of the day' or a 'quote of the day' or an 'image of the day'. I'm going to use it in a vBulletin message board - for example in a 'movies' section, it will display a random title of a movie every day, and then that movie is the movie of the day for discussion - and in a cooking section, display a word, a fruit or vegetable or something, and that will be the 'food of the day' to discuss.

Does anyone know of a php program that's free, or low cost, that could do this? And have you used it yourself, and do you think it woudl work with a vbulletin?

Dani AI

Generated

Three practical ways to add a "word/quote/image of the day" for the use-cases described by (movies, food, etc.): (1) random on every page load, (2) deterministic daily (the same item for everyone during a given day), or (3) server-side rotation where a cron job picks and stores a single "current" item once per day. 's pointer to standalone PHP quote scripts is useful for (1); 's suggestion to look for vBulletin-specific mods is the safest route if template edits must be avoided.

A compact, reliable method for a true "item of the day" is a date-seeded selection from a flat file or DB. The example below assumes an items.txt where each line is either a text-only item or "text|image_path". It produces the same selection for everyone on the same date and avoids hitting the DB each page view.

<?php
// deterministic "item of the day" from items.txt (each line: text OR text|image.jpg)
date_default_timezone_set('UTC'); // adjust to the forum timezone if needed
$items = array_values(array_filter(array_map('trim', file('items.txt'))));
if (!$items) return;
$seed = intval(sprintf('%u', crc32(date('Y-m-d'))));
$index = $seed % count($items);
$line = $items[$index];
list($text, $img) = array_pad(explode('|', $line, 2), 2, '');
$text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
echo '<div class="rotator">';
if ($img) echo '<img src="'.htmlspecialchars($img, ENT_QUOTES, 'UTF-8').'" alt="'.$text.'">';
echo '<div>'.$text.'</div>';
echo '</div>';
?>

Integration notes and common pitfalls: include the script from a header/custom block or use a vBulletin mod if raw PHP is not allowed in templates; for DB-backed sets, avoid ORDER BY RAND() on large tables and prefer id-based selection or a precomputed daily index. Check server timezone (midnight shifts), file permissions, correct absolute/relative image paths, HTML escaping to prevent XSS, and any caching layer (board cache/CDN) that might prevent daily changes. Also verify rights to reuse quotes/images if content is not original.

Recommended Answers

All 4 Replies

I would suggest looking for one at www.vbulletin.org instead since they have mods that specifically tailor to vBulletin.

Try asking in their Modification Support forums as well :)

I didn't find one at vb.org - I even asked about someone making one, and that's when someone told me there were already free php scripts out there that would do it, but they didnt have any to recommend.. LOL

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.