HellRazor
11-12-2005, 01:49 AM
This module is based off a random content thread I found over at vbulletin.org.
1. Upload the following file to your forum directory under the name content.txt (these are just a few quotes, but you can change the file to contain whatever random content you want to display):
"I know the price of success; dedication, hard work and an unremitting devotion to the things you want to see happen."--Frank Lloyd Wright
"What makes life dreary is want of motive."--George Eliot
“Doing business without advertising is like winking at a girl in the dark. You know you’re doing it but nobody else does."--Steuart Henderson Brit
2. Upload the following file to your forum directory under the name rand_con.php (edit the $file = path to the path you saved content.txt):
<?php
$file = "http://www.yourdomain.com/forums/content.txt";
$fp = file($file);
srand((double)microtime()*1000000);
$random_content = $fp[array_rand($fp)];
echo "$random_content";
?>
3. In your admincp, go to Plugin System, then Add New Plugin. Add the following plugin:
Hook Location: global_start
Title: Random Content
Plugin PHP Code:
ob_start();
include('rand_con.php');
$random_content = ob_get_contents();
ob_end_clean();
4. Add a new template:
Title: adv_portal_random_content
Template:
<tr>
<td class="thead"><span class="smallfont"></span></td>
</tr>
<tr>
<td class="$altbgclass"><span class="smallfont"></span></td>
</tr>
<tr>
<td class="$bgclass"><span class="smallfont">$random_content
</span></td>
</tr>
5. Finally, go to VBA CMPS, Add Module, choose 'Template', and add the following:
Module Name: Random Content
Template to include: random_content
Use Module Shell Template: Yes
You should now have a module that displays random text from the content.txt file.
1. Upload the following file to your forum directory under the name content.txt (these are just a few quotes, but you can change the file to contain whatever random content you want to display):
"I know the price of success; dedication, hard work and an unremitting devotion to the things you want to see happen."--Frank Lloyd Wright
"What makes life dreary is want of motive."--George Eliot
“Doing business without advertising is like winking at a girl in the dark. You know you’re doing it but nobody else does."--Steuart Henderson Brit
2. Upload the following file to your forum directory under the name rand_con.php (edit the $file = path to the path you saved content.txt):
<?php
$file = "http://www.yourdomain.com/forums/content.txt";
$fp = file($file);
srand((double)microtime()*1000000);
$random_content = $fp[array_rand($fp)];
echo "$random_content";
?>
3. In your admincp, go to Plugin System, then Add New Plugin. Add the following plugin:
Hook Location: global_start
Title: Random Content
Plugin PHP Code:
ob_start();
include('rand_con.php');
$random_content = ob_get_contents();
ob_end_clean();
4. Add a new template:
Title: adv_portal_random_content
Template:
<tr>
<td class="thead"><span class="smallfont"></span></td>
</tr>
<tr>
<td class="$altbgclass"><span class="smallfont"></span></td>
</tr>
<tr>
<td class="$bgclass"><span class="smallfont">$random_content
</span></td>
</tr>
5. Finally, go to VBA CMPS, Add Module, choose 'Template', and add the following:
Module Name: Random Content
Template to include: random_content
Use Module Shell Template: Yes
You should now have a module that displays random text from the content.txt file.