Ajax XML Ticker (txt file source) in a block (SMF and Tiny Portal)

Started by Dieter, May 30, 2006, 02:23:54 AM

Previous topic - Next topic

Dieter

(This requires that you have the Tiny portal mod installed.)
I wanted a cool little ticker in one of my Tiny Portal [nofollow] blocks on my site www.prowebdesign.no [nofollow] (the ticker used in the "Recent templates" block). As you can see, it fades in and out the most recent templates added here. This is not a default function in Tiny Portal so you have to do some small modifications in the source code. 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 [nofollow]

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/ [nofollow] 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 :)
[nofollow]

Advertisement: