vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Promotional Hack (JS animation 4 recent posters) (https://vborg.vbsupport.ru/showthread.php?t=5084)

11-30-2000 06:12 PM

My first hack, a humble contribution in case anyone has a use for it.

Purpose: Encourage new members to post. Eventually will be used to run contests, promotions, etc.

What it does: When a member posts a new message, the main forum page will display a flying animation. For our diet forum, the "whoosh fairy" was appropriate (and cute). The user will see this animation until someone else posts to that forum.

In terms of rules: If the user is the last poster in any forum that is "on" the animation will show.
Can be easily modified to be more complex, but as a new forum, I hope it encourages participation.


Note: Can't figure why it doesn't work for Netscape. If you find the bug, please post here.

Needed files: animate.js from tutorial at:
http://www.webreference.com/js/column18/index.html

--

One php file to edit index.php

Find:

$lastposter="by $forum[lastposter]";

Add below:
Code:

            //myhack
            if ($forum[lastposter]==$bbusername and $onoff=="on"){
              $greeting=1;
            }
            //myhack

Find:

eval("echo dovars(\"".gettemplate("forumhome")."\");");

Add above it:

Code:

//myhack
  if ($greeting){
      $greeting="";
      eval("\$greeting .= \"".gettemplate("afairyon")."\";");
  } else
  { $greeting="";}
//myhack

Add a new template, I called it afairyon:

Code:

<DIV id=whoosh
style="LEFT: -100px; WIDTH: 25px; POSITION: absolute; TOP: 800px"><IMG
src="images/flying.gif" hight=80 width=95></DIV>
<SCRIPT language=JavaScript1.2>
<!--
document.write("<SCRIPT SRC='animate.js'></SCRIPT>");
onload = start;
function start() {
  anim2 = new animation("whoosh");
  anim2.slideBy(600, -900, 150, 16);}
// -->
</SCRIPT>

In the forumhome template, after $footer, add:

$greeting

That's it.

Edited: Changed $username to $bbusername

[Edited by tamarian on 12-03-2000 at 11:22 PM]

12-01-2000 04:53 AM

The reason why it doesn't work for Netscape is because it's DHTML, and a lot of DHTML is not supported by NN, btw I think it would be a better idea to have a flash animation of some sort, but I liked the hack, good job!

12-01-2000 04:56 AM

BTW I created an account for test purposes called guest, so people can test it with out having register:

Account infor for tests:

Username: guest
Password: guest

12-01-2000 04:58 AM

I just tested it, and I'm sorry man but I found it very annoying, especially on a large board!

12-01-2000 03:33 PM

Quote:

Originally posted by conan
BTW I created an account for test purposes called guest, so people can test it with out having register:

Account infor for tests:

Username: guest
Password: guest


Keep in mind, if you use this account, you have to delete previous recent messages by guest. If the test forum has guest as last poster and the lightbulb is "on" the animation will occur without any new post.

12-01-2000 03:45 PM

Quote:

Originally posted by conan
I just tested it, and I'm sorry man but I found it very annoying, especially on a large board!
Could be easily modified to show less frequently. My problem is that we're NOT a big board yet.

If the frequency is annoying, add a randomizer to the js scricp, something like:

var cur=Math.round(19*Math.random());
function start() {
if (cur>=17){

If the animation itself is annoying, find another one :) This particular animation is very relavent to our members, and they loved it.


All times are GMT. The time now is 09:07 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.00957 seconds
  • Memory Usage 1,724KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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