vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Blinking Introduction Text (https://vborg.vbsupport.ru/showthread.php?t=41321)

Velocd 07-20-2002 10:00 PM

Blinking Introduction Text
 
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:
PHP Code:

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

Above it place:
PHP Code:

if($forum['forumid'] == 3// This number needs to be the id of your introduction forum.
           
{
             if(
$bbuserinfo[usergroupid] == && $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:
PHP Code:

$templatesused 

And replace it with:
PHP Code:

$templatesused 'forumhome_introbit, 


3. Create a new template: forumhome_introbit
Code:

<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?

Quote:

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/showthrea...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 :)


All times are GMT. The time now is 03:48 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.01104 seconds
  • Memory Usage 1,753KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)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