Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Ask the 8ball Details »»
Ask the 8ball
Version: 1.00, by dymo dymo is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-29-2002 Last Update: Never Installs: 5
Is in Beta Stage  
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 05-31-2002, 07:16 PM
BigJohnson BigJohnson is offline
 
Join Date: Nov 2001
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like this hack alot and i have added more than a couple hundred different sayings to this 8 Ball. If someone else can create this hack to work with my 8 ball that i made with photoshop and insert the message inside the ball that would be awesome. That would be cool if there was a fading effect when you clicked the buttons after typing in your question and the page doesnt refresh to see you answer. Right when you click the button the 8 ball will fade to the answer. Is anyone with me on this one and willing to help?
Reply With Quote
  #13  
Old 07-10-2002, 06:51 PM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can look at my version here.
Reply With Quote
  #14  
Old 07-11-2002, 02:05 PM
BigJohnson BigJohnson is offline
 
Join Date: Nov 2001
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you please post your version. That would be great. It looks great. Thanks.
Reply With Quote
  #15  
Old 07-11-2002, 02:27 PM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Îê. Everything in the txt file.

THANKS Dymo for the nice forum addon!
Reply With Quote
  #16  
Old 07-11-2002, 04:19 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This part is kindof confusing in your text file:

Step 2: Replace in 8ball.php the last section to:

As is this part:

include("./footer.php"); //may be in your case it should be deleted

Can you please explain it a little better to this newbie?

Quote:
Originally posted by GenSec
??. Everything in the txt file.

THANKS Dymo for the nice forum addon!
Reply With Quote
  #17  
Old 07-11-2002, 04:42 PM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If your forum is just VB page
Replace Dymo
PHP Code:
          srand((double) microtime() * 1000000);
          
$count count($answers);
 eval(
"dooutput(\"".gettemplate("8ball")."\");");
          echo 
"You asked:<b> ";
          echo 
$requiredquestion;
          echo 
"</b><br><br>and the answer is: <b> " .
$answers[rand(0,$count)];
  }

  
?> 
without
PHP Code:
include("./footer.php"); 
It's for those who like me using it on nonVb page and has footer.php file.
Reply With Quote
  #18  
Old 07-11-2002, 06:36 PM
BigJohnson BigJohnson is offline
 
Join Date: Nov 2001
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ya but can the answer go somewhere else besides below the footer. I hate that part.
Reply With Quote
  #19  
Old 07-12-2002, 05:11 AM
GenSec GenSec is offline
 
Join Date: Oct 2001
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by BigJohnson
Ya but can the answer go somewhere else besides below the footer. I hate that part.
Why below. I said above and you can see on my page that problem just to move up eval("dooutput(\"".gettemplate("8ball")."\");");

PHP Code:
 <?
 require("./global.php");
if(!$bbuserinfo[userid]) {
  eval("dooutput(\"".show_nopermission()."\");");

 eval("dooutput(\"".gettemplate("8ball")."\");");
  if (isset($requiredquestion)) {
          $answers = array( "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">Yes</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">No</font>",                                                                           
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">Of Course</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">Never</font>",
                                  "Maybe",
                                  "Theres a Chance",
                                  "What do you think I am, psychic?",
                                  "Sometimes",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">Im quit sure about that!</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">Thats probably true</font>", 
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">Hell no..</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">Dont even think about it....</font>",
                                  "Maby , maby not",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">You may count on it</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">The chanse is quit as big as seeing Jay Leno in a
g-string</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">I would not even concider it..</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">I must say yes...</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">Damnd right ...</font>",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"blue\">Sure thing.</font>.",
                                  "<font face=\"MS Sans Serif\" size=\"2\"
color=\"red\">Hahah your kidding right?</font>",
                                         
                                  "<font face=\"MS Sans Serif\" size =\"2\"
color=\"blue\">If you're lucky</font>");
          srand((double) microtime() * 1000000);
          $count = count($answers);
         echo "<table border=\"0\" align=\"center\" width=\"300\" cellpadding=\"3\" cellspacing=\"1\"><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: {codefontcolor}; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: {codebackground};\">";
         echo "$bbuserinfo[username]: <b>$requiredquestion</b>";
          echo "</td></tr><tr><TD style='filter:alpha(opacity=10)' onmouseover='nereidFade(this,100,30,5)' onmouseout='nereidFade(this,10,50,5)' background='images/3D.jpg' border=0 HEIGHT='300'  VALIGN='MIDDLE'><center><b>".
$answers[rand(0,$count)];
          echo "</center> </b></td></tr></table>";


  } else {

         echo "<table border=\"0\" align=\"center\" width=\"300\" cellpadding=\"3\" cellspacing=\"1\"><tr><td style=\"BORDER: #000000 1px solid; FONT-SIZE: 11px; COLOR: {codefontcolor}; FONT-FAMILY: Verdana,Arial; BACKGROUND-COLOR: {codebackground};\">";
         echo "$bbuserinfo[username]: <b></b>";
          echo "</td></tr><tr><TD style='filter:alpha(opacity=10)' onmouseover='nereidFade(this,100,30,5)' onmouseout='nereidFade(this,10,50,5)' background='images/3D.jpg' border=0 HEIGHT='300' ALIGN='CENTER' VALIGN='MIDDLE'><b><img src='http://www.2x2online.com/forum/$avatarurl'  border=0>";
          echo "</b></td></tr></table>";
}
  ?>
Reply With Quote
  #20  
Old 07-12-2002, 01:45 PM
BigJohnson BigJohnson is offline
 
Join Date: Nov 2001
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ya thats what i have but the answer is below the footer on my site.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:07 PM.


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.08349 seconds
  • Memory Usage 2,362KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete