vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Forum in Focus (https://vborg.vbsupport.ru/showthread.php?t=62140)

Toneboy 03-02-2004 10:00 PM

Forum in Focus
 
Posting this here, as I believe you're meant to do first off. Plus it could probably be improved a touch. Thought I would share it anyway.

Basically it is for use with portals, as it gives some indication of what each forum is. Handy if people pass by your front page and haven't visited your forums yet, as it gives a description of an individual forum after the title.

Anyway, here's the code:
PHP Code:

<?
// this line needs to be set to point to your config.php file.
include("$DOCUMENT_ROOT/forums/includes/config.php");
 $db=mysql_connect($servername,$dbusername,$dbpassword); 
mysql_select_db($dbname); 

// set admin forum
$adminforum = 1;

// MySql query
$sql =mysql_query("SELECT * FROM forum WHERE forumid != $adminforum AND displayorder != 0 AND threadcount > 1 ORDER BY RAND() LIMIT 1");

 // Loop out of DB & PHP, into HTML
 while ($news = mysql_fetch_array($sql)){

$forumid = $news["forumid"];
$forumname = $news["title"];
$forumdes = $news["description"];
}
mysql_free_result($sql);


echo "<table width=\"100%\" border=\"0\"><tr><td align=\"center\"><font class=\"feed\"><b><a href=\"/forums/forumdisplay.php?f=$forumid\">$forumname</a></b></font></td></tr><tr><td align=\"left\"><font class=\"feed\">$forumdes</font></td></tr></table>";
?>


refertech 03-03-2004 09:20 PM

Screen Shot please. :)

ChrisSy 03-03-2004 09:38 PM

i think you meant for this to be in beta hacks?

Edit:\ weird its showing up as 'latest hack' on mainpage

Kentaurus 03-03-2004 09:52 PM

Quote:

Originally Posted by Toneboy
Posting this here, as I believe you're meant to do first off. Plus it could probably be improved a touch. Thought I would share it anyway.

Basically it is for use with portals, as it gives some indication of what each forum is. Handy if people pass by your front page and haven't visited your forums yet, as it gives a description of an individual forum after the title.

Anyway, here's the code:
PHP Code:

<?
// this line needs to be set to point to your config.php file.
include("$DOCUMENT_ROOT/forums/includes/config.php");
 $db=mysql_connect($servername,$dbusername,$dbpassword); 
mysql_select_db($dbname); 

// set admin forum
$adminforum = 1;

// MySql query
$sql =mysql_query("SELECT * FROM forum WHERE forumid != $adminforum AND displayorder != 0 AND threadcount > 1 ORDER BY RAND() LIMIT 1");

 // Loop out of DB & PHP, into HTML
 while ($news = mysql_fetch_array($sql)){

$forumid = $news["forumid"];
$forumname = $news["title"];
$forumdes = $news["description"];
}
mysql_free_result($sql);


echo "<table width=\"100%\" border=\"0\"><tr><td align=\"center\"><font class=\"feed\"><b><a href=\"/forums/forumdisplay.php?f=$forumid\">$forumname</a></b></font></td></tr><tr><td align=\"left\"><font class=\"feed\">$forumdes</font></td></tr></table>";
?>


Some of us have more than I admin forum, adminforum should be a comma separated list and the query should be and forumid not in ($adminforum), or something like that :)

Also, you should really include global.php to have the standard $DB_site object and to use all the forum usergroup constraints.

obiwan8472 03-03-2004 11:27 PM

Screenie shotty please

LeeCHeSSS 03-04-2004 07:54 AM

Quote:

Originally Posted by obiwan8472
Screenie shotty please

There isn't much to take a screenshot of: this piece of code simply randomly selects one forum on your board and displays a table *ick* with the forumname and its description.

It doesn't use templates, and isn't of much use on its own - it needs to be used in your already existant portal.

gmarik 03-05-2004 04:19 PM

Some info and a demo site would be just fine ...


All times are GMT. The time now is 06:28 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.01013 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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