Uploading a good JavaScript Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Uploading a good JavaScript

    avatar
    merry2
    New Member


    Posts : 10
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Uploading a good JavaScript

    Post by merry2 June 1st 2012, 1:52 am

    Second newbie question, first is working like a charm thanks! (got the dropdown menu working here: http://mastertester.forumotion.net/)

    Okay the new situation: I have a good, clean JavaScript and have it tested and working here:

    http://pithyproductions.com/demos/script-test.html

    I want to upload this script to my phpBB3 forum and have it display at the top as the header in place of the Forum main logo.

    I know to upload it to MODULES > Javascript codes management and turn it on.

    QUESTION: How do I tell it to display this script in the header in place of the Forum main logo??

    Thanks again for a great forum,
    Merry


    Last edited by merry2 on June 1st 2012, 1:54 am; edited 1 time in total (Reason for editing : typo.)
    MotorCookie
    MotorCookie
    Forumember


    Male Posts : 113
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by MotorCookie June 1st 2012, 2:33 am

    You will have to go to 'Display' in the admin panel and in the section 'Templates', are a bunch of different parts of your forum. You will have to edit things there. Only templates of phpbb2 or PunBB versions will be affected.
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by LGforum June 1st 2012, 2:40 am

    Well what you linked to is not JavaScript, but only powered by JavaScript.
    The HTML can go where you want it, only the actual JavaScript will need to go in JS management.

    Unless of course it is purely JavaScript, in which case documentation will be provided somewhere, and at some point in the JS you'd likely specify the element in which to display the slideshow.

    I don't know I'm on a phone, but that's generally how they work.
    avatar
    merry2
    New Member


    Posts : 10
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by merry2 June 1st 2012, 2:52 am

    MotorCookie wrote:You will have to go to 'Display' in the admin panel and in the section 'Templates', are a bunch of different parts of your forum. You will have to edit things there. Only templates of phpbb2 or PunBB versions will be affected.

    Hmm, as I said this is phpBB3. Does this still apply or?

    Merry
    avatar
    merry2
    New Member


    Posts : 10
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by merry2 June 1st 2012, 3:39 pm

    LGforum wrote:Well what you linked to is not JavaScript, but only powered by JavaScript. The HTML can go where you want it, only the actual JavaScript will need to go in JS management...

    Well the JavaScript is pasted into the linked page, it was a test to show the script is indeed working perfectly outside of phpBB3.

    My whole question is when you say "The HTML can go where you want it,..." I want it in the header in place of the logo! But the logo box is for linking to an image, not a script. Let's say the script is named "foo.js" Where do I paste "foo.js" into a box in the Admin???

    Thank you again for helping me puzzle through this.
    Merry
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by LGforum June 1st 2012, 4:36 pm

    It just depends on a lot of things though really. The slide elements seem to being created with JS, so at some point it must ask you where you want the elements to be placed. It must need the ID of an element on page.

    Can I ask where you got it from so I can see the documentation/API notes?

    If the script is named "foo.js" then placing the script in the page with:
    '<script src="foo.js"></script>' would be needed.
    avatar
    merry2
    New Member


    Posts : 10
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by merry2 June 1st 2012, 4:42 pm

    LGforum wrote:It just depends on a lot of things though really. The slide elements seem to being created with JS, so at some point it must ask you where you want the elements to be placed. It must need the ID of an element on page.

    Can I ask where you got it from so I can see the documentation/API notes?

    If the script is named "foo.js" then placing the script in the page with:
    '<script src="foo.js"></script>' would be needed.

    Thanks LGforum but when you say "in the page" ... can I use FTP to download the template files and put it IN THE PAGE? I thought I was restricted to Admin only, so I've been asking where in the Admin do I put the script. If I can use FTP I have no more worries.

    Merry

    ps The script is from http://www.barelyfitz.com/projects/slideshow/wizard/ an extremely simple online slideshow wizard I have used successfully for many many years.
    LGforum
    LGforum
    Hyperactive


    Male Posts : 2265
    Reputation : 264
    Language : English
    Location : UK

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by LGforum June 1st 2012, 4:52 pm

    Nah there's no FTP access on FM.

    I'd say your best thing to do is put it all in an announcement. ACP > General > Announcements.

    But remove this line:
    Code:

    <a href="javascript:SLIDES.hotlink()"><img name="SLIDESIMG"
    src="tgrfed" STYLE="filter:progid:DXImageTransform.Microsoft.Fade()" BORDER=0 alt="Slideshow image"></A>

    Then find this chunk in the script:
    Code:

    if (document.images) {
      SLIDES.image = document.images.SLIDESIMG;
      SLIDES.textid = "SLIDESTEXT";
      SLIDES.update();
      SLIDES.play();
    }
    And change it to this:
    Code:

    if (document.images) {
      SLIDES.image = document.getElementById('logo').firstChild;
      SLIDES.textid = "SLIDESTEXT";
      SLIDES.update();
      SLIDES.play();
    }

    then when you've done that. Let me know if thats worked. If it hasn't please leave it all as it is, so I can see what else needs changing.
    avatar
    merry2
    New Member


    Posts : 10
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by merry2 June 1st 2012, 9:03 pm

    LGforum wrote:Nah there's no FTP access on FM.

    I'd say your best thing to do is put it all in an announcement. ACP > General > Announcements.

    But remove this line:
    Code:
    ...
    then when you've done that. Let me know if thats worked. If it hasn't please leave it all as it is, so I can see what else needs changing.

    LGforum,

    I did not realize I could have an "announcement" on all pages - that was where I was stumped. Thank you!

    Before your edits the NOSCRIPT version was working on this page.

    After I did your edits I just have a blank announcement box.

    It is here: http://mastertester.forumotion.net/f1-your-first-forum

    Merry <-- SO, SO grateful to you!

    Merry


    Last edited by merry2 on June 1st 2012, 9:15 pm; edited 1 time in total (Reason for editing : Clarification)
    avatar
    merry2
    New Member


    Posts : 10
    Reputation : 1
    Language : English

    Uploading a good JavaScript Empty Re: Uploading a good JavaScript

    Post by merry2 June 1st 2012, 10:02 pm

    LGforum wrote:...I'd say your best thing to do is put it all in an announcement. ACP > General > Announcements...

    Okay to test JavaScript in announcements, I put up this classic one:

    <script type="text/JavaScript">
    <!--
    document.write("Hello World!")
    //-->
    </script>

    But alas, nothing appears. Is JavaScript stripped out of Announcements??

    Test site with Hello World script in announcement: http://mastertester.forumotion.net/