PDA

View Full Version : Blinking Introduction Text


Velocd
07-20-2002, 10:00 PM
File edits: 1 (index.php)
New templates: 1
Install time: 4 minutes
Demo or Screentshot: Yes, see attachment.

The following is a small hack I compiled pretty quick, but I'm sure it'll be a great help for new members of your forum. This hack may only appeal to those using an introduction forum, so you may or may not need this. Although, this code could be manipulated in numerous other ways to bring your forum home page other cool tricks.


What does Velocds' hack do?
Assuming you have an introduction forum, new members with a post count of zero will see a blinking text message next to the title of your intro forum. Only registered members will also see this text.

The reason I needed this hack is because the first post I would prefer by a member to make is their introduction, so other members get to know alittle more about them. I have also had some members post their introduction in the wrong forum. This hack will hopefully guide them to the correct forum.


Known bugs:
When tested with Mozilla, the javascript blinking text did not work. You can still see the link, but it wont blink. :(
The text you use should not be very long, or else it will get "word wrapped" around below the forum title. If you know how to make it so more characters are available, let me know! ;)


A more improved version from Velocd:
Ok, I don't know how to do this that is why I'm asking you guys. A more improved version of this hack would be to check whether or not that user has made an introduction thread yet, not whether they are past their zero post count. Although checking if they have a post count might also help, since not all members may want to make an introduction thread. If you know how to do this please let me know so I can update the hack! ^^



---------------- Installation ----------------

1. In index.php, find:

eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");


Above it place:

if($forum['forumid'] == 3) // This number needs to be the id of your introduction forum.
{
if($bbuserinfo[usergroupid] == 2 && $bbuserinfo[posts] == 0)
{
eval("\$introtext .= \"".gettemplate("forumhome_introbit")."\";");
$forum['title'] .= "$introtext";
}
}


Where the number 3 is, you have to change this to the id of your introduction forum, as it states in comments.


2. Find the following:

$templatesused = '


And replace it with:

$templatesused = 'forumhome_introbit,



3. Create a new template: forumhome_introbit

<script language="JavaScript"> <!-- Script from Nakkid blinking PM -->
window.onerror=null;
var bName=navigator.appName;
var bVer=parseInt(navigator.appVersion);
var NS4=(bName=='Netscape' && bVer>=4);
var IE4=(bName=='Microsoft Internet Explorer' && bVer>=4);
var i=0;

// blinking text speed (change it to suit your taste)
var blinkspeed=700;

if (NS4||IE4) {
if (navigator.appName=='Netscape') {
layerStyleRef='layer.';
layerRef='document.layers';
styleSwitch='';
} else {
layerStyleRef='layer.style.';
layerRef='document.all';
styleSwitch='.style';
}
}

function blink(layerName) {
if (NS4||IE4) {
if(i%2==0) {
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
} else {
eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
}
}
if(i<1) {
i++;
} else {
i--;
}
setTimeout("blink('"+layerName+"')",blinkspeed);
}
</script>

</a><smallfont>&nbsp;-&nbsp;
<a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$forum[forumid]" id="intro">
make an intro now!</a>
<script language="javascript">blink('intro');</script>
</smallfont>



And that is it :)
Thnx go to Nakkid since I used that javascript blinking text code from your header PM's. If there is a blinking text script that works with Mozilla, let me know ;)

Velocd
07-21-2002, 01:10 AM
*cough* Wow Velocd this hack is really useful *cough*

Velocd responds: Why thank you ^^ I'm always gratiful for the user feedback ;)

... :sleep:

DrkFusion
07-21-2002, 02:10 AM
:banana:
;)

Thanks man, it worked, pretty easy to install, and the newbies, are suprised and just sitting there staring at it.

"Man, look at it go" -SupaTroo

lol one of the members

Keep it up!

Boofo
07-21-2002, 02:42 AM
Nice hack! I modified it a bit since I don't have an intro forum and used it to blink on my forum rules forum. :)

Velocd
07-21-2002, 03:37 AM
Yeah there are alot of nifty ways to manipulate this code I have thought of, such as your example. I am thinking of adding it to my announcement forum, and making it blink whenever I make a new announcement, until that member views the announcement. Alot of members on my forum seem to avoid the announcement forum..

Floris
07-21-2002, 03:41 AM
Nice idea :)

Boofo
07-21-2002, 04:03 AM
If you figure out how to do this so that it will stop blinking when they read it, let me know. I could use it for that, too. You CAN use it for more than one prupose at the same time, right? If so, how would you do it?

Originally posted by Velocd
Yeah there are alot of nifty ways to manipulate this code I have thought of, such as your example. I am thinking of adding it to my announcement forum, and making it blink whenever I make a new announcement, until that member views the announcement. Alot of members on my forum seem to avoid the announcement forum..

Velocd
07-21-2002, 04:51 AM
Well I know how to do everything but what I have requested for help here:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=41326

PS to lionel who has fallen asleep at his keyboard: wake up! you've been viewing this thread for it seems like hours :)

Chris M
07-21-2002, 11:04 AM
Nice:)

Satan

inetd
07-23-2002, 02:21 AM
Good hack!
Click install :)

Velocd
08-13-2002, 02:17 AM
Fixing bugs on my forum today I ran across this hack again and realized I could easily make it check to see if the user has a post made in the introduction thread.

----------------------------------

Assuming you have this hack installed already, and you want it to blink the introduction text UNTIL a member has made a thread in teh intro area, OR has below 10 posts (since sometimes they might now want to make a intro-thread), do this:

In index.php, find:

{
if($bbuserinfo[usergroupid] == 2 && $bbuserinfo[posts] == 0)
{
eval("\$introtext .= \"".gettemplate("forumhome_introbit")."\";");
$forum['title'] .= "$introtext";
}
}


Replace it with:

{
if($bbuserinfo[posts] < 10) {
if (!$check=$DB_site->query_first("SELECT postuserid FROM thread WHERE postuserid=$bbuserinfo[userid] AND forumid=3")) {
eval("\$introtext .= \"".gettemplate("forumhome_introbit")."\";");
$forum['title'] .= "$introtext";
}
}
}


Now see where the forumid=3 is? Set this value to whatever your introduction forumid is.

And that is it. If you don't want it to check if the user has less than 10 posts, just comment out that if-statement.

TranceMaster
02-16-2003, 02:45 PM
excellent man
just what i need :)

EchoHype.com
02-16-2003, 03:02 PM
Hey velocd

very nice hack. useful and simple ;)

uomoragno
03-15-2003, 02:02 PM
small modification :)

In index.php, find:

eval("\$forumbits .= \"".gettemplate("forumhome_forumbit_level$depth$tempext")."\";");

Above it place:

$announcementsforumid=$DB_site->query_first("SELECT value FROM setting WHERE varname='announcementsforumid'");
if ($bbuserinfo['lastvisitdate']=='Never') {

if($forum['forumid'] == $announcementsforumid['value'] ) {
eval("\$introtext .= \"".gettemplate("forumhome_introbit")."\";");
$forum['title'] .= "$introtext";
}
}
else {
if (($fview = get_bbarraycookie('forumview', $forum['forumid'])) > $bbuserinfo['lastvisit']) {
$userlastvisit=$fview;
} else {
$userlastvisit=$bbuserinfo['lastvisit'];
}
if ($userlastvisit<$forum['lastpost']) {
if($forum['forumid'] == $announcementsforumid['value'] ) {
eval("\$introtext .= \"".gettemplate("forumhome_introbit")."\";");
$forum['title'] .= "$introtext";
}
} else {

}
}

and

INSERT INTO setting (settinggroupid,title,varname,value,description,op tioncode,displayorder)
VALUES ('5','Blinking Tex Forum Id','Blinkforumid','',
'Which forum do you want to use a Blinking Text? Fill in the forumid, please.','','14')");

Dean C
03-15-2003, 02:51 PM
What does that do uomoragno?

Also velocd - this hack was never added to the db :)?

- miSt

jbear6
03-15-2003, 03:11 PM
Nice Hack! Would there be a way to call the members name in the flashing text? Something like: "c'mon {username} introduce yourself!"?

Thaks
Jbear6

Link14716
03-15-2003, 06:24 PM
$bbuserinfo[username] would call the member's name :)

Xanthine
03-15-2003, 06:57 PM
I keep getting a php error when adding the first block of code. hmmm

Splitfyre
06-26-2003, 03:53 AM
Works great :)

Bulleh
06-26-2003, 10:26 AM
nothing happens for me