Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
UKBL ~ Newsticker IFrame in Navbar Details »»
UKBL ~ Newsticker IFrame in Navbar
Version: 1.00, by UKBusinessLive UKBusinessLive is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.8.1 Rating:
Released: 03-13-2009 Last Update: Never Installs: 13
Template Edits
Re-useable Code Translations  
No support by the author.

UKBL ~ Newsticker IFrame in Navbar


Working Demo: http://www.ukbusinesslive.co.uk/forum With Border

Working Demo: http://www.waltdisneyboards.com/forums.php Without Border


As a request for a friend, i made this simple to add news ticker using a simple html script from Dynamic Drive and added it to the navbar, left of the login box, Now your members will be able to see up to date news everytime they login



So Easy to Install

First Download the zip file and open the ticker.txt file in a text editor like notepad

To legally use the code from Dynamic Drive please retain their credits within the code

Code:
<!--<UKBL Iframe Ticker Start>----------------------------------------------------------------------->

<td class="alt2">
<DIV ALIGN=RIGHT>
<if condition="$show['member']">
<!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
<!--This credit MUST stay intact for use-->
<iframe id="tickermain" src="http://yourforum.com/exfile.htm" width=200 height=80 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
</DIV>
</td>
</if>
<!--<UKBL Iframe Ticker End>----------------------------------------------------------------------->
Find

Code:
src="http://yourforum.com/exfile.htm"
and replace it with yoursite and keep the file exfile.htm at root level (We'll need to edit that file later )

Find

Code:
width=200 height=80
and change this for the size you want, I've kept mine small 200 x 80 pixels but you can edit this for whatever size you want to make the Iframe :up:

Find this

Code:
scrolling=no
and change it to yes if you want the iframe to scroll as opossed to just changing. if no then the content will change ever XX seconds which is adjustable

Now we save that file and we need to copy and paste the entire contents of that file to our Navbar, so...

AdminCP > Styles & Templates> Style Manager> Your Chosen Style> All style options> Edit templates> Navigation / Breadcrumb Templates> navbar

Find the following

Code:
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
and directly below it add your code

Code:
<!--<UKBL Iframe Ticker Start>----------------------------------------------------------------------->

<td class="alt2">
<!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
<!--This credit MUST stay intact for use-->
<DIV ALIGN=RIGHT>
<if condition="$show['member']">
<iframe id="tickermain" src="C:\Users\Gerry\Desktop\exfile.htm" width=200 height=80 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
</DIV>
</td>
</if>
<!--<UKBL Iframe Ticker End>----------------------------------------------------------------------->
Ok Guys thats the first bit done,
Grab yourselves a beer, Here comes part two

In Notpad again open the "exfile.htm" file, as we need to edit and add our content :up:

When you open the file in Notepad we see this, remember to keep the Dynamic drive url and copyright in place

Code:
<script language="JavaScript1.2">

//IFRAME TICKER- By Dynamic Drive (http://www.dynamicdrive.com)

//configure delay between changing messages (3000=3 seconds)
var delay=3000

var ie4=document.all

var curindex=0
var totalcontent=0

function get_total(){
if (ie4){
while (eval("document.all.content"+totalcontent))
totalcontent++
}
else{
while (document.getElementById("content"+totalcontent))
totalcontent++
}
}

function contract_all(){
for (y=0;y<totalcontent;y++){
if (ie4)
eval("document.all.content"+y).style.display="none"
else
document.getElementById("content"+y).style.display="none"
}
}

function expand_one(which){
contract_all()
if (ie4)
eval("document.all.content"+which).style.display=""
else
document.getElementById("content"+which).style.display=""
}

function rotate_content(){
get_total()
contract_all()
expand_one(curindex)
curindex=(curindex<totalcontent-1)? curindex+1: 0
setTimeout("rotate_content()",delay)
}

window.onload=rotate_content

</script>

<BODY bgColor=#FFFFE1>

<!--ADD YOUR TICKER CONTENT BELOW, by wrapping each one inside a <DIV> as shown below.-->
<!--For each DIV, increment its ID attribute for each additional content (ie: "content1", "content2" etc)-->


<div id="content0" style="display:''">

<!-- ADD TICKER's CONTENT #1 HERE--------------------->

<p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
code encrypter</a>&nbsp;</small></font></strong><br>
<font face="Verdana" size="2">Scramble the source of any chunk of code using
this unique script.</font></p>

<!-- END CONTENT #1----------------->

</div>

<div id="content1" style="display:none">

<!-- ADD TICKER's CONTENT #2 HERE--------------------->

<p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
links</a>&nbsp;</small></font></strong><br>
<font face="Verdana"><small>Bring attention to special links, by making them
flash!</small></font></p>

<!-- END CONTENT #2----------------->

</div>

<div id="content2" style="display:none">

<!-- ADD TICKER's CONTENT #3 HERE--------------------->

<p align="left"><small><strong><font face="Verdana"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
Cursor</a>&nbsp;</font></strong></small><br>
<small><font face="Verdana">Display a second, &quot;roaming&quot; cursor on your
page with this fun animation script.</font></small></p>

<!-- END CONTENT #3----------------->

</div>

<div id="content3" style="display:none">

<!-- ADD TICKER's CONTENT #4 HERE--------------------->

<p align="left"><font face="Verdana"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated
Document title</small></a><br>
</strong><small>Animate into view your document's title!</small></font></p>

<!-- END CONTENT #4----------------->

</div>
Find this

Code:
var delay=3000
and change it for whatever delay you want, remember its in milliseconds so 3 seconds = 3000

next Find this

Code:
<BODY bgColor=#FFFFE1>
This changes the color of the iframe background, Use a hex color generator to chose a color which suits your site, I use this http://www.2createawebsite.com/build/hex-colors.html

Find this

Code:
<!-- ADD TICKER's CONTENT #1 HERE--------------------->

<p align="left"><strong><font face="Verdana"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
code encrypter</a>&nbsp;</small></font></strong><br>
<font face="Verdana" size="2">Scramble the source of any chunk of code using
this unique script.</font></p>

<!-- END CONTENT #1----------------->
these are the text blocks, Just edit them to suit your content

You'll see how easy it is, The first part is the url of your link, Then the text after it, once you've done a couple you'll get the knack

if you want to add more, make sure you......

Code:
<!--ADD YOUR TICKER CONTENT BELOW, by wrapping each one inside a <DIV> as shown below.-->
<!--For each DIV, increment its ID attribute for each additional content (ie: "content1", "content2" etc)-->
Thats it, so now we need to save the file, and upload the file (exfile.htm) to our forums root directory.

Thats it, Now click onto your homepage and suprise your members with your New feature

Please click Install if you use and i'll support you 100%

Download Now

File Type: zip navbar-Iframe.zip (36.4 KB, 72 views)

Screenshots

File Type: png Iframe in navbar.png (37.7 KB, 0 views)

Show Your Support

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

Comments
  #12  
Old 03-14-2009, 05:33 PM
hoopsta hoopsta is offline
 
Join Date: Jan 2003
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ArnyVee View Post
I've got it started (still testing), but you can use my site for the demo http://www.waltdisneyboards.com/forums.php

Gerry, I'd like to ask a question. I noticed that the text wasn't aligned towards the top. Where do I put the valign="top" piece?

Also, what do I do to change the color (or eliminate, rather) the borders on the iFrame?
would you mind telling me which hack you use for the Top 5 Stats ?
Reply With Quote
  #13  
Old 03-14-2009, 05:43 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ArnyVee View Post
I've got it started (still testing), but you can use my site for the demo http://www.waltdisneyboards.com/forums.php

Gerry, I'd like to ask a question. I noticed that the text wasn't aligned towards the top. Where do I put the valign="top" piece?

Also, what do I do to change the color (or eliminate, rather) the borders on the iFrame?

Hi Arny,

Not sure what you mean about the align= top?? It works OK on my Test Site?? Post me a link when you get it up?

To make the Border disappear in the ticker.txt file find

Code:
frameborder=1
and change to

Code:
frameborder=0
Just going to get my demo done on my site bear with me for a sec....
Reply With Quote
  #14  
Old 03-14-2009, 05:46 PM
Jon Tolzien Jon Tolzien is offline
 
Join Date: Nov 2008
Location: Grand Forks, ND
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright i loaded it and everything but a couple of small problems.
1. Can this scroll right to left, like a stock ticker..... Does this automatically scroll?
2. Can this be centered in the navbar
3. I cannot get it to scroll at all, i probably screwed something up

I love this idea, i have been looking for one that is quality for a long time.

Thanks for the help

Code:
<script language="JavaScript1.2">

//IFRAME TICKER- By Dynamic Drive (http://www.dynamicdrive.com)

//configure delay between changing messages (3000=3 seconds)
var delay=3000

var ie4=document.all

var curindex=0
var totalcontent=0

function get_total(){
if (ie4){
while (eval("document.all.content"+totalcontent))
totalcontent++
}
else{
while (document.getElementById("content"+totalcontent))
totalcontent++
}
}

function contract_all(){
for (y=0;y<totalcontent;y++){
if (ie4)
eval("document.all.content"+y).style.display="none"
else
document.getElementById("content"+y).style.display="none"
}
}

function expand_one(which){
contract_all()
if (ie4)
eval("document.all.content"+which).style.display=""
else
document.getElementById("content"+which).style.display=""
}

function rotate_content(){
get_total()
contract_all()
expand_one(curindex)
curindex=(curindex<totalcontent-1)? curindex+1: 0
setTimeout("rotate_content()",delay)
}

window.onload=rotate_content

</script>

<BODY bgColor=#333333>

<div align="center">
  <!--ADD YOUR TICKER CONTENT BELOW, by wrapping each one inside a <DIV> as shown below.-->
  <!--For each DIV, increment its ID attribute for each additional content (ie: "content1", "content2" etc)-->
  <strong><font color="#FFFFFF" face="Verdana">Welcome to Diversified Online Gamers!!!</font></strong>
</div>
<div id="content1" style="display:none">

  <div align="center"><font color="#FFFFFF">
  <!-- ADD TICKER's CONTENT #2 HERE--------------------->
    
<strong>  <<strong><font face="Verdana">Welcome to Diversified Online Gamers!!!</font></strong></small></font>
    </p></strong>
    
    <!-- END CONTENT #2----------------->
    </font></div>
</div>

<div id="content2" style="display:none">

  <div align="center"><font color="#FFFFFF">
  <!-- ADD TICKER's CONTENT #3 HERE--------------------->
    
    <strong><font color="#FFFFFF" face="Verdana">Welcome to Diversified Online Gamers!!!</font></strong>
</div>
  <!-- END CONTENT #3----------------->
  </font></div>
</div>
<div id="content3" style="display:none">
Reply With Quote
  #15  
Old 03-14-2009, 05:48 PM
ArnyVee's Avatar
ArnyVee ArnyVee is offline
 
Join Date: Mar 2008
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gerry, it's working now. :up:

I forgot that you had the "show 'member'" in there. So, I removed that (and noticed where to put the "0" for the frameborder too ) and it should be good.

Now, just working on aligning the text to the top to make it look nicer.
Reply With Quote
  #16  
Old 03-14-2009, 05:53 PM
ArnyVee's Avatar
ArnyVee ArnyVee is offline
 
Join Date: Mar 2008
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hoopsta View Post
would you mind telling me which hack you use for the Top 5 Stats ?
No problem sir!

I use the Cyb-Advanced Forum Stats. If you're using vB 3.8, go here https://vborg.vbsupport.ru/showthread.php?t=201274 ... if you're using vB 3.7, go here https://vborg.vbsupport.ru/showthread.php?t=177778

Thanks for comments, by the way! :up:

The demo on my site is working other than the text being down a bit (almost as if there are some line breaks in there somewhere), so I'm adjusting that now.

I have it blending into (no iFrame border or differentiating background color) my site. So, Gerry could use this one as another option in his demos.
Reply With Quote
  #17  
Old 03-14-2009, 06:04 PM
hoopsta hoopsta is offline
 
Join Date: Jan 2003
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks Arny... I just uploaded the stat hack. I like this newsticker thing to....
Reply With Quote
  #18  
Old 03-14-2009, 06:07 PM
ArnyVee's Avatar
ArnyVee ArnyVee is offline
 
Join Date: Mar 2008
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem Hoopsta!

Yes, Gerry does a lot of helpful and fun modifications for our community. :up:

I'm happy that others have liked the ideas as well.
Reply With Quote
  #19  
Old 03-14-2009, 06:11 PM
hoopsta hoopsta is offline
 
Join Date: Jan 2003
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is a dumb question, but once this is set up all we need to do is edit: exfile.htm and that will change newsticker info?
Reply With Quote
  #20  
Old 03-14-2009, 06:14 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jon Tolzien View Post
Alright i loaded it and everything but a couple of small problems.
1. Can this scroll right to left, like a stock ticker..... Does this automatically scroll?
2. Can this be centered in the navbar
3. I cannot get it to scroll at all, i probably screwed something up

I love this idea, i have been looking for one that is quality for a long time.

Thanks for the help
Hi Jon, To answer your Questions

1. This will scroll from bottom to top if you want, for right to left you'll need something like this, My scrolling marquee hack https://vborg.vbsupport.ru/showthread.php?t=207241

2. if you align this in the centre of the navbar, then it will mess up the forum breadcrumb and make the navbar wider, It need to be in its own "cell" next to the login, if you want an iframe in the centre then you can just add My scrolling Forum news to the header https://vborg.vbsupport.ru/showthread.php?t=207002 demo: http://www.ukbusinesslive.co.uk/forum/scroller.htm

3. To get this hack to scroll bottom to top go to the ticker.txt file and find
Code:
scrolling=no
Just change the attribute to=yes

You can see how this works on my demo: www.ukbusinesslive.co.uk/forum
Reply With Quote
  #21  
Old 03-14-2009, 06:16 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hoopsta View Post
this is a dumb question, but once this is set up all we need to do is edit: exfile.htm and that will change newsticker info?
Thats right, edit the exfile.htm file and upload the file to your forum root directory

I've addd a demo on my forum www.ukbusinesslive.co.uk/forum
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 11:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05094 seconds
  • Memory Usage 2,374KB
  • Queries Executed 26 (?)
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
  • (15)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete