Code Conversion

Started by Ronald, January 19, 2014, 02:09:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ronald

I was browsing the Internet the other night and came across a Zeta Board that had a Registration Popup Image.

So I looked around and found the code, but it will not work on SMF, I made some changes and tried different things, still will not work.

Have a look at the Code and see if maybe we can somehow change it so it'll work on SMF.

<script type="text/javascript">
//<![CDATA[
$(function () {
    var iURL = 'URL_IMAGE';

    if ($.zb.logged_in === false) {
        if ($.zb.get('sIMG') !== 'true') {
            $('#main').append('<a href="'   main_url   'register/"><img id="sIMG" src="'   iURL   '" alt="Register" style="position: fixed; bottom: 20px; right: 5px" /></a><a href="javascript: void(0);" id="sIMG-close" style="position: fixed; bottom: 5px; right: 5px">Close</a>');
        }

        $('#sIMG-close').click(function () {
            $.zb.set('sIMG', true);
            $('#sIMG, #sIMG-close').hide('slow');
        });
    }
});
//]]>
</script>

Thanks Ron..

Skhilled

Hmmm, I'm no coder but believe the problem is with the following variables: zb, iURL and sIMG.

I have never seen those in SMF before and assume that they are local to the board you are referring to and used in it somehow. You would have to change those vars to whatever the SMF equivelant is...

OR, initialize them in SMF somehow so they will work but that is beyond my knowledge.

Ronald

Agent Moose made this code, he does codes for ZB and SMF. His two boards are closed and they refer you to SMF free forum support board, but AgentMoose hasn't posted they in over a year.  So I figure he has moved on being a young kid..

I Registered there and made one post but the board looks as dead as a door nail.

Thanks Steve..

Ron..

beast



  I don't know any thing about code. Well, I take that back. I know enough to brake ever thing. I would like to know where to put it and then try it with out the i, s, and zb. I wonder if it would work then?

   :taz:
Thanks [you] for reading my post

Skhilled

Those are variables that hold specific information. This part:

var iURL = 'URL_IMAGE';

is telling iURL to hold the url of an image but it is not globally initialized yet. The other 2 vars are not initialized at all and I've never seen them in SMF so I'm not sure what they relate to originally.