Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 active news
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

top
Junior Member

150 Posts

Posted - 28 April 2010 :  17:47:00  Show Profile
help find a code News
What Hwa proper law
News Forum Moving from left to right
View or withholding section in bar news
On or Off News


Edited by - top on 28 April 2010 17:47:43

AnonJr
Moderator

United States
5768 Posts

Posted - 28 April 2010 :  18:00:39  Show Profile  Visit AnonJr's Homepage
Huh? If you are having problems explaining in clear English; could you at least point to an example?
Go to Top of Page

top
Junior Member

150 Posts

Posted - 29 April 2010 :  04:38:57  Show Profile
Hi AnonJr
I am not so much savvy on AJAX and Javascript. I need help please. I am trying to create a news ticker like the one in the BBC site.
I was able to do it manually with javascript. I want the data to be populated from a database. I created an array variable that holds the data but
I dont know how to tie it with AJAX. See the code below:



<body>
<div class="ticki"> <a id="tickerAnchor" href="#" target="_top" class="tickl"></a></div>

<script language="JavaScript" type="text/javascript">
<!--
// Ticker startup
function startTicker()
{
    // Define run time values
    theCurrentStory     = -1;
    theCurrentLength    = 0;
    // Locate base objects
    if (document.getElementById) {    
            theAnchorObject     = document.getElementById("tickerAnchor");
            runTheTicker();       
         }
    else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
    }
}
// Ticker main run loop
function runTheTicker()
{
    var myTimeout;  
    // Go for the next story data block
    if(theCurrentLength == 0)
    {
        theCurrentStory++;
        theCurrentStory      = theCurrentStory % theItemCount;
        theStorySummary      = theSummaries[theCurrentStory].replace(/"/g,'"');        
        theTargetLink        = theSiteLinks[theCurrentStory];
        theAnchorObject.href = theTargetLink;
        thePrefix          = "<span class=\"tickls\">" + theLeadString + "</span>";
    }
    // Stuff the current ticker text into the anchor
    theAnchorObject.innerHTML = thePrefix +
    theStorySummary.substring(0,theCurrentLength) + whatWidget();
    // Modify the length for the substring and define the timer
    if(theCurrentLength != theStorySummary.length)
    {
        theCurrentLength++;
        myTimeout = theCharacterTimeout;
    }
    else
    {
        theCurrentLength = 0;
        myTimeout = theStoryTimeout;
    }
    // Call up the next cycle of the ticker
    setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
    if(theCurrentLength == theStorySummary.length)
    {
        return theWidgetNone;
    }

    if((theCurrentLength % 2) == 1)
    {
        return theWidgetOne;
    }
    else
    {
        return theWidgetTwo;
    }
}
// -->
</script>
    

    
    <script language="JavaScript" type="text/javascript">
    <!--

    var theCharacterTimeout = 50;
    var theStoryTimeout     = 5000;
    var theWidgetOne        = "_";
    var theWidgetTwo        = "-";
    var theWidgetNone       = "";
    var theLeadString       = "";

    var theSummaries = new Array();
    var theSiteLinks = new Array();

// This is where you say how many links you want....

    var theItemCount = 13;

        theSummaries[0] = "News Forum <b>HOWTODOIT</b> Bringing news from the databases <b>Myfreeforum</b>.    Block Group's View News   ";
theSiteLinks[0] = "http:// your link here";

      

        theSummaries[1] = "New Myfreeforum Arcade Coming Soon Play Games And compete Against Over 10,000 Forums";
theSiteLinks[1] = "http:// your link here";
        
    
        theSummaries[2] = "<b>Portals ??? </b> If You Can Not Find Your Answer Here, Or You Wish To Request One, Then Why Not Try----> ";
theSiteLinks[2] = "http:// your link here";
       
    
        theSummaries[3]="------------------------------------------------><b>Portalogy</b><------------------------";
        theSiteLinks[3] = "http://portalogy.myfastforum.org";


theSummaries[4] = "The Only Portal help Site On The Myfreeforum System------>Run By Our Portal King <b>Nick(NR)</b>,---------";
theSiteLinks[4] = "http:// your link here";
       

theSummaries[5] = "Do You Need Banners, Logos , Icons Or Any Art Done For Free By <b>Bravo</b> And His Team Then Why Not Try -----------> . ";
theSiteLinks[5] = "http:// your link here";
       

theSummaries[6] = " ----------------------------------------------><b>CGARTS</b><-------------- . ";
        theSiteLinks[6] = "http://cgarts.myfreeforum.org";


theSummaries[7] = "My <b>Top Forum</b> Link Goes To ----------> . ";
theSiteLinks[7] = "http:// your link here";
       

theSummaries = "---------------------------------------> <b>BABBLING BOOKS</b> <---------------------------- . ";
        theSiteLinks = "http://www.babblingbooks.org.uk";

theSummaries[9] = "A Very Well Run Forum With A Fresh Clean Crisp look About It, Also A forum based On Posts Not Extras. ";
        theSiteLinks[9] = "http:// your link here";

theSummaries[10] = "There Are At The Moment No Major Updates that Have Been Released The Next One On The List Is  <b>Myfreeforum Arcade</b>. ";
theSiteLinks[10] = "http:// your link here";
        

theSummaries[11] = "I Hope This Site Has Been Useful, Remember This <b>You Learn Nothing By Copy And Paste</b>---------->. ";
theSiteLinks[11] = "http:// your link here";
       

theSummaries[12] = "<b>Symon</b> Says <b>Practice Makes for True Knowledge.</b>";
       theSiteLinks[12] = "http:// your link here";




            

    startTicker();
    
    //-->
    </script>
</body>
</html>




Edited by - top on 01 May 2010 10:26:25
Go to Top of Page

top
Junior Member

150 Posts

Posted - 01 May 2010 :  10:25:30  Show Profile
Wait for answers
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07