TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,965
  • Latest: boruko
Stats
  • Total Posts: 195,980
  • Total Topics: 21,320
  • Online today: 281
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 300
  • Total: 300

Ajax XML Ticker (txt file source) in a block

Started by Dieter, May 30, 2006, 08:02:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dieter

I wanted a cool little ticker in one of my blocks on my site www.prowebdesign.no (the ticker used in the "Recent templates" block). As you can see, it fades in and out the most recent templates added here. I thought maybe someone else could be interested in this too :). Ok, the first thing you need to do is to get the Ajax ticker, which you can download for free here:

http://www.dynamicdrive.com/dynamicindex2/ajaxticker.htm

Now you have to open your index.template.php and find </head>, (remember to backup) right above add:

      <script src="ajaxticker.js" type="text/javascript">
/***********************************************
* Ajax Ticker script (txt file source)- ÂÃ,© Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
</script>


Save your file and upload it to your themes/yourtheme/index.template.php again

Now, open your style.css for your theme and add:

/*My ticker styler*/

#ajaxticker1{
width: 200px;
height: 100px;
border: 1px ridge black;
padding: 5px;
background-color: #FEEEB8;
}

#ajaxticker1 div{ /*IE6 bug fix when text is bold and fade effect (alpha filter) is enabled. Style inner DIV with same color as outer DIV*/
background-color: #FEEEB8;
}

.someclass{ //class to apply to your scroller(s) if desired
}


Upload it where it belongs (themes/yourtheme/style.css)


  • Upload ajaxticker.js to the root folder of your forum.
  • Edit the tickercontent.txt and add your content using regular html.
  • Upload your tickercontent.txt to the root folder of your forum.

To display the ticker go to your admin panel and paste this script in a block (remember to use the script box):

<script type="text/javascript">

var xmlfile="tickercontent.txt" //path to ticker txt file on your server.

//ajax_ticker(xmlfile, divId, divClass, delay, optionalfadeornot)
new ajax_ticker(xmlfile, "ajaxticker1", "someclass", 3500, "fade")
</script>


You should now have a nice little ticker on your site :)

Aleko

Really nice, works fine :up:

Only 1 question : is it possible to randomize ?

Dieter

It's probably possible if you edit the Javascript, Unfortunately I don't know much about Javascritpt :(

Aleko

Thanks anyway for the reply and for sharing the script ;) :up:

This website is proudly hosted on Crocweb Cloud Website Hosting.