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:
//myhack
if ($forum[lastposter]==$bbusername and $onoff=="on"){
$greeting=1;
}
//myhack
Find:
eval("echo dovars(\"".gettemplate("forumhome")."\");");
Add above it:
//myhack
if ($greeting){
$greeting="";
eval("\$greeting .= \"".gettemplate("afairyon")."\";");
} else
{ $greeting="";}
//myhack
Add a new template, I called it afairyon:
<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]
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:
//myhack
if ($forum[lastposter]==$bbusername and $onoff=="on"){
$greeting=1;
}
//myhack
Find:
eval("echo dovars(\"".gettemplate("forumhome")."\");");
Add above it:
//myhack
if ($greeting){
$greeting="";
eval("\$greeting .= \"".gettemplate("afairyon")."\";");
} else
{ $greeting="";}
//myhack
Add a new template, I called it afairyon:
<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]