vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Ask the 8ball (https://vborg.vbsupport.ru/showthread.php?t=38060)

dymo 04-29-2002 10:00 PM

Ask the 8ball
 
this is another one of those scriptlets i had collected that i modified to provide a bit of fun for my users but its giving me a bit of a problem, its completely functional, just the response to the question is being parsed to the top of the page rather than under the question

add a template called 8ball
and insert the following
PHP Code:

<html>

<
head>
<
SCRIPT LANGUAGE="JavaScript">

<!-- 
Begin
function checkrequired(which) {
var 
pass=true;
if (
document.images) {
for (
i=0;i<which.length;i++) {
var 
tempobj=which.elements[i];
if (
tempobj.name.substring(0,8)=="required") {
if (((
tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!
pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Error you did not post any "+shortFieldName+" , try again.");
return 
false;
}
else
return 
true;
}
//  End -->
</script>
<
title>$bbtitle Ask the 8Ball?</title>

$headinclude

</head>

<
body>

$header

<table cellpadding="2" cellspacing="0" border="0" width="{contenttablewidth}" {tableinvisibleextraalign="center">

<
tr>

        <
td width="100%"><img src="{imagesfolder}/vb_bullet.gif" alt="" border="0" align="absmiddle">

        <
normalfont><b><a href="index.php?s=$session[sessionhash]">$bbtitle</a> &gt;

       
Ask the 8Ball?</b></normalfont></td>

</
tr>

</
table>

<
br>



<
table cellpadding="{tableouterborderwidth}" cellspacing="0" border="0" {tableouterextrawidth="70%" align="center"><tr><td>



<
table cellpadding="10" cellspacing="0" border="0" width="100%"><tr>
      <
td
        <
table width="100%" border="0" cellspacing="0" cellpadding="0">
          <
tr
            <
td>
<
font size="2" face="MS Sans Serif">
<
br><br>
  <
b>Ask the magic 8ball a question!</b>
  <
br>
  <
form onSubmit="return checkrequired(this)" method=post action='8ball.php'>
  <
input type=text size=31 name="requiredquestion" value='Your Question'>
  <
br>
  <
input type=submit value='Ask the Magic 8Ball?'></form><br>
</
td>
       
          </
tr>
        </
table>
        <
table cellpadding="4" cellspacing="1" border="0" bgcolor="{tablebordercolor}" width="100%"
        <
tr>

    <
td colspan="5" bgcolor="{tableheadbgcolor}"><normalfont color="{tableheadtextcolor}"><center><b></b></center></normalfont></td>

  </
tr>



  <
tr>
<
div align="center">

 </
div>
$footer
</body

copy the attached 8ball.php into your forums directory
and then run it ie http://yoursite.com/forums/8ball.php

you can see a working demo here

DWZ 04-30-2002 05:20 AM

augh, need to register :\

can you post a screenshot?

dymo 04-30-2002 05:49 AM

sorry about that forgot i added in the user check to the 8ball system
here are the screen shots
http://www.gamer-networks.com/forums/images/8ball-q.jpg
http://www.gamer-networks.com/forums/images/8ball-a.jpg

John 04-30-2002 06:24 AM

That answer doesn't look too hopeful :S

Admin 04-30-2002 06:38 AM

Quote:

Originally posted by JohnWarwick
That answer doesn't look too hopeful :S
That's the whole point of 8-Ball. ;)

tweak 04-30-2002 07:45 AM

Kool Hack but i get these errors on your forum???

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site2/fst/var/www/html/forums/8ball.php:1) in /home/virtual/site2/fst/var/www/html/forums/admin/functions.php on line 1647

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site2/fst/var/www/html/forums/8ball.php:1) in /home/virtual/site2/fst/var/www/html/forums/admin/functions.php on line 1647

Also the answer appears in the top corner??

Floris 04-30-2002 11:24 AM

Does that javascript work on ie5 and ns4 and opera & mozilla ?

dymo 04-30-2002 04:17 PM

Quote:

Originally posted by tweak
Kool Hack but i get these errors on your forum???

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site2/fst/var/www/html/forums/8ball.php:1) in /home/virtual/site2/fst/var/www/html/forums/admin/functions.php on line 1647

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site2/fst/var/www/html/forums/8ball.php:1) in /home/virtual/site2/fst/var/www/html/forums/admin/functions.php on line 1647


Also the answer appears in the top corner??

the answer in the corner is a bug hence its a beta release.

the header info you get on my forums is in the process of being hacked right now to support multiple cookies, just refresh it and it goes away.

if anyone has an idea of how to get the answer to appear under the question i could really use it


Xi the js should work on anything higher than ie 4 and ns 4, if the browser cnt use it , it should ignored, the js only provides the idiot correct of someone submitting a blank question
d

M.Smith 05-04-2002 07:17 PM

Quote:

Originally posted by xiphoid
Does that javascript work on ie5 and ns4 and opera & mozilla ?
im suprised ns4 supports html never mind that js :p

GenSec 05-08-2002 10:57 AM

Quote:

Originally posted by dymo


the answer in the corner is a bug hence its a beta release.


Move
PHP Code:

 eval("dooutput(\"".gettemplate("8ball")."\");"); 

up. Place before
PHP Code:

  if (isset($requiredquestion) AND $requiredquestion!="") { 



All times are GMT. The time now is 12:37 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.01102 seconds
  • Memory Usage 1,776KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete