SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member seboyd2000's Avatar
    Join Date
    Jul 2004
    Location
    world
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help creating newsticker block

    Ive been trying to get this shortnews.com javascript Newsticker set up in a php block. I know I'm almost there, can someone please help me correct the code, thanks.

    This is the original javascript:
    =============================<script language="Javascript">
    var tickerheight=95;
    var tickerwidth=150;
    var fontcolor="#616161";
    var tickercolor="#FFFFFF";
    var bordercolor="#3333FF";
    var bordersize=1;
    var fontspace=5;
    var fontsize=9;
    var visitedlink="#3366CC";
    var rollovercolor="#FF6600";
    var font="Verdana";
    var speed=75;
    var pause=2500;
    var sparte=4;
    var rubrik=13;
    var ticker_stop=1;
    var rollover_underline=1;
    var font_underline=0;
    var tickertyp=2;
    var u_id=58473;
    </script>
    <script language="JavaScript" src="http://newsticker.shortnews.com/com/js/free/2/ticker.js"></script>

    =========================

    This is what I did with it:
    ======================================

    <?php
    if (eregi("block-NewsTicker.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
    }
    $content = "<script language=\"Javascript\">";
    $content .= "var tickerheight=95;";
    $content .= "var tickerwidth=150;";
    $content .= "var fontcolor=\"#616161\";";
    $content .= "var tickercolor=\"#FFFFFF\";";
    $content .= "var bordercolor=\"#3333FF\";";
    $content .= "var bordersize=1;";
    $content .= "var fontspace=5;";
    $content .= "var fontsize=9;";
    $content .= "var visitedlink=\"#3366CC\";";
    $content .= "var rollovercolor=\"#FF6600\";";
    $content .= "var font=\"Verdana\";";
    $content .= "var speed=75;";
    $content .= "var pause=2500;";
    $content .= "var sparte=4;";
    $content .= "var rubrik=13;";
    $content .= "var ticker_stop=1;";
    $content .= "var rollover_underline=1;";
    $content .= "var font_underline=0;";
    $content .= "var tickertyp=2;";
    $content .= "var u_id=58473;";
    $content .= "</script>";
    $content .= "<script language=\"JavaScript\" src=\"http://newsticker.shortnews.com/com/js/free/2/ticker.js\"></script>";

    ?>



    ===============================================

    Thanks for the help....

  2. #2
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First of all, what's your problem?
    You don't actually tell us what's wrong.

    Second, why are you using die() then calling more code?
    die() causes the script to hault execution, so you won't be able to set any variables after die() is called.

    And as a quick note: header("Location: blah") only works if NO output has been sent to the browser (even whitespace) yet.
    Also notice the quotes and lowercase.
    The functions are case sensitive and you need the quotes as you're passing a string.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  3. #3
    SitePoint Member seboyd2000's Avatar
    Join Date
    Jul 2004
    Location
    world
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, I hear ya. As I said in my first post the javascript newsticker above, I want to create a block from it, but no matter how I write it it wont show up in the block, sometimes I get error, but when I correct them I get this message in the block:

    There isn't content right now for this block.

    The comments you made are noted, but I used VinDsl convertor for the one above and that is how it came out. I've used it before and it worked. Now it doesnt work on this javascript.

    I've downloaded a few html2php convertors I found in a search, but they can get this java script working either.

    All Im trying to do is take that original javascript above and create a block from it, so I'll have a 3rd party newsticker, thats all.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •