vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   featured member forum (https://vborg.vbsupport.ru/showthread.php?t=74538)

Murphinator 01-17-2005 06:53 PM

featured member forum
 
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

Quote:

Originally Posted by MarcoH64
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 Code:

<?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.


All times are GMT. The time now is 10:47 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01042 seconds
  • Memory Usage 1,736KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete