vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Random Content [Basic] (https://vborg.vbsupport.ru/showthread.php?t=91082)

ResaleBroker 06-24-2005 10:00 PM

Random Content [Basic]
 
For those times when a database solution is overkill here is an alternative. With this easy modification you can display content, pulled randomly on page load, from a text file. Possible content includes tips, quotes, banners, etc.


1) Open the content.txt file and replace the current content with your own. (One quote, etc. per line.)

2) Upload the content.txt file to your server in the forum directory.

3) Open the rand_con.php file and modify the file path to the content.txt file on your server.

4) Upload the rand_con.php file to your server in the forum directory.


5) Open "Common Templates":
Admin CP >> Styles & Templates >> Style Manager >> All Style Options


6) In the phpinclude_start area add:
HTML Code:

ob_start();
include('rand_con.php');
$random_content = ob_get_contents();
ob_end_clean();

7) Now place a reference to $random_content where you want the resulting HTML to be displayed.

That's it! Your done! :)

cinq 06-26-2005 12:09 AM

U included a styleset in your zip :)

ResaleBroker 06-26-2005 12:15 AM

Quote:

Originally Posted by cinq
U included a styleset in your zip :)

Fixed. ;)

TheComputerGuy 06-26-2005 04:35 AM

Anyway just to have that simple box around it like yours?

ResaleBroker 06-26-2005 05:05 AM

Quote:

Originally Posted by TheComputerGuy
Anyway just to have that simple box around it like yours?

Sure. You can place the content in "any" container. For instance, a simple table or "box":

HTML Code:

<!-- Boxed Random Content -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="page" align="left" width="100%">$random_content</td>
</tr>
</table>
<!-- End Boxed Random Content -->


MindTrix 06-26-2005 09:31 AM

Heres a load of random quotes for you to use.

ResaleBroker 06-26-2005 04:37 PM

Quote:

Originally Posted by MindTrix
Heres a load of random quotes for you to use.

That's a load of scripts alright. Thanks! ;)

MindTrix 06-26-2005 05:02 PM

Most welcome.

Joe Gronlund 07-02-2005 02:44 PM

Is there anyway to get this to work with vB 3.5.0 ????

ResaleBroker 07-02-2005 03:06 PM

Quote:

Originally Posted by Joe Gronlund
Is there anyway to get this to work with vB 3.5.0 ????

I haven't seen vB 3.5 however I would imagine this should still work.


All times are GMT. The time now is 08:16 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.01100 seconds
  • Memory Usage 1,732KB
  • 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_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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