View Full Version : featured member forum
Murphinator
01-17-2005, 06:53 PM
ive been trying to learn php to do this:
what i want to do is have a featured member forum, i dont know any 3rd party or how the cron files work so can someone make a moderation for this, what i want to have done is the featured member forum change at midnight to a different member forum. any ideas?
Marco van Herwaarden
01-17-2005, 08:31 PM
explain more what you want please.
Andreas
01-17-2005, 08:57 PM
explain more what you want please.
I second that :)
Murphinator
01-17-2005, 09:53 PM
umm ok, here it goes,
what im going to do is im going to make forums for members that request them, these forums will be theres to post thoughts about life and other things in there lifes, kind of like diaries...
now with the featured thing, i want a random diary to be picked everyday and be show with the title and description, so its featured
Andreas
01-17-2005, 10:04 PM
For diaries i'd suggest one of the journal hacks.
Murphinator
01-17-2005, 10:28 PM
yeah but i want forums. i really good example is http://forums.govteen.com
Murphinator
01-18-2005, 02:22 AM
anyone, i really need this, so please help
Murphinator
01-18-2005, 02:43 PM
ok then someone please tell me how
Marco van Herwaarden
03-07-2005, 03:47 PM
Ok, Please test this good first:
1. Create a new Forum on the place you want to featured forum to show up.
2. Enter a Title and if wanted a description
3. Set a display order
4. LEAVE THE REST EMPTY!!!! (or put a link to a forum in "Forum Link")
now save the following into a new file in your includes/cron directory:
<?php
// Sample featured forum cron script by MarcoH64
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($DB_site))
{
exit;
}
// Define the featured forum link, insert forumid
$featuredforumlink = 6;
// Fill array with forumids to choose from
$chooseforums = array(2,4,5);
// No more changes needed under this
// Select random forum
$selected = $DB_site->query_first("SELECT forumid from " . TABLE_PREFIX . "forum
WHERE forumid IN (" . implode(",",$chooseforums) . ")
ORDER BY RAND()
LIMIT 1
");
// Update forum info
$DB_site->query("UPDATE " . TABLE_PREFIX . "forum
SET link = '$vboptions[bburl]/forumdisplay.php?f=$selected[forumid]'
WHERE forumid = $featuredforumlink
");
require_once('./global.php');
build_forum_permissions();
log_cron_action("Featured Forum Updated. New featured forum: $selected[forumid]", $nextitem);
?>
Edit the $featuredforumlink and the $chooseforums var's.
Setup the new cronjob with a schedule you want. All should go auto now.
PS This is an example on how you could do it, change for your needs.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.