News:

Wondering if this will always be free?  See why free is better.

Main Menu

My donation button doesnt work in the forum

Started by PLAYBOY, October 24, 2014, 05:01:33 AM

Previous topic - Next topic

PLAYBOY

I add the below code to my index.template.php in different places (footer, header, body etc.) but the button just doesnt show.
When I add the same script on my html homepage, it shows tho.

So where and how can I add this script to my forum so it`ll show on every page?
It adjusts the position of itself to top right automatically.

<script src="http://site.com/btc/coin.js"></script>
<script>
site.go({

/* make sure you update the wallet_address or you will not get your donations */
wallet_address: "1C8masdfEbbrPpaJRATLLuu1DoimqQv"

, currency: "bitcoin"
, counter: "hide"
, alignment: "bl"
, qrcode: true
, auto_show: false
});
</script>

Bob Perry of Web Presence Consulting

Quote from: PLAYBOY on October 24, 2014, 05:01:33 AM
I add the below code to my index.template.php in different places (footer, header, body etc.) but the button just doesnt show.
When I add the same script on my html homepage, it shows tho.

So where and how can I add this script to my forum so it`ll show on every page?
It adjusts the position of itself to top right automatically.

<script src="http://site.com/btc/coin.js"></script>
<script>
site.go({

/* make sure you update the wallet_address or you will not get your donations */
wallet_address: "1C8masdfEbbrPpaJRATLLuu1DoimqQv"

, currency: "bitcoin"
, counter: "hide"
, alignment: "bl"
, qrcode: true
, auto_show: false
});
</script>


You have to enclose your entire snippet of code inside an echo'(yourcodehere)'; sequence...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

PLAYBOY

Quote from: Bob Perry on October 24, 2014, 05:06:56 AM
Quote from: PLAYBOY on October 24, 2014, 05:01:33 AM
I add the below code to my index.template.php in different places (footer, header, body etc.) but the button just doesnt show.
When I add the same script on my html homepage, it shows tho.

So where and how can I add this script to my forum so it`ll show on every page?
It adjusts the position of itself to top right automatically.

<script src="http://site.com/btc/coin.js"></script>
<script>
site.go({

/* make sure you update the wallet_address or you will not get your donations */
wallet_address: "1C8masdfEbbrPpaJRATLLuu1DoimqQv"

, currency: "bitcoin"
, counter: "hide"
, alignment: "bl"
, qrcode: true
, auto_show: false
});
</script>


You have to enclose your entire snippet of code inside an echo'(yourcodehere)'; sequence...


I add it between the other codes like this

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];


echo '
<script type="text/javascript"><!-- // -->','
function capsLock(e, div)
{
keyCode = e.keyCode ? e.keyCode : e.which;
shiftKey = e.shiftKey ? e.shiftKey : ((keyCode === 16) ? true : false);
if (((keyCode >= 65 && keyCode <= 90) && !shiftKey) || ((keyCode >= 97 && keyCode <= 122) && shiftKey))
{
document.getElementById(div).style.visibility = \'visible\';
}
else
{
document.getElementById(div).style.visibility = \'hidden\';
}
}
// ]]','></script>



</head>

<script src="http://site.com/btc/coin.js"></script>
<script>
site.go({

/* make sure you update the wallet_address or you will not get your donations */
wallet_address: "1C8masdfEbbrPpaJRATLLuu1DoimqQv"

, currency: "bitcoin"
, counter: "hide"
, alignment: "bl"
, qrcode: true
, auto_show: false
});
</script>

<body> ';
}

function template_body_above()


Is it wrong? Can you give me a full example of where and how I should put it?

Bob Perry of Web Presence Consulting

almost right, you'll need to put      ';     right after </script> in the header, then you need to do the echo' + ending    ';   for the one in the body too...
Best Regards,
Bob Perry



"The world is moving so fast these days that the man who says it can't be done is generally interrupted by someone doing it." Elbert Hubbard

PLAYBOY

I dont get it. After which </script> I should put the ;` and also I add my codes within the echo and `; already.
Could you please give me the whole code after you correct it and let me try it like that?

Kindred

ummm.... you put it BEWTEEN the closing of the head tag and the opening of the body tag?

That will never work.  it's "no man's land"....

it either needs to be IN the head or IN the body
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PLAYBOY

I am not familiar with coding.
Could someone please just fix the code and paste it here so I can copy and paste and try it like that?

PLAYBOY

Quote from: Kindred on October 24, 2014, 06:29:46 AM
ummm.... you put it BEWTEEN the closing of the head tag and the opening of the body tag?

That will never work.  it's "no man's land"....

it either needs to be IN the head or IN the body

Oh yeah by the way. I tried putting it right after the <body> also but still didnt work

Illori

adding that code to anywhere in smf i dont think will work, the coin.js file itself loads 2240 LINES of html code that includes a head and body section, both of which already exist in smf.

sorry this code will not work in the SMF structure.

see attachment for what got added...

unless site.com is not the correct site... the actual code you are using would be more helpful then.

PLAYBOY

Quote from: Illori on October 24, 2014, 07:35:28 AM
adding that code to anywhere in smf i dont think will work, the coin.js file itself loads 2240 LINES of html code that includes a head and body section, both of which already exist in smf.

sorry this code will not work in the SMF structure.

see attachment for what got added...

unless site.com is not the correct site... the actual code you are using would be more helpful then.

I appreciate you tried so hard but of course site.com is not my site.
I had to censor the wallet address and the site url. Everything else is same.
My coin.js is 300 lines only.
Also as I mentioned before, when I put the code in an html page it works perfectly. It even works in WordPress. But it just doesnt work in SMF when I put it in index.template.php

Also there is no http://site.com/btc/coin.js file. It just redirects you to another html file.

Kindred

why don't you drop it into a portal block or in the ad manager?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PLAYBOY

I did put it in the ad manager and it didnt work again.
I dont use a portal

Illori

if the coin.js file redirects you to an html file then it might be building its own webpage that may not work in smf at all.

if you are talking about the code given here http://coindonationwidget.com/ the test code they give works just fine and shows up.

PLAYBOY

Quote from: Illori on October 24, 2014, 07:58:28 AM
if the coin.js file redirects you to an html file then it might be building its own webpage that may not work in smf at all.

if you are talking about the code given here http://coindonationwidget.com/ the test code they give works just fine and shows up.

I got it from another site but yeah this is the widget. My script works when i embed it in an HTML
but just not SMF.
It even works in WP. That`s why I`m writing here to see anyone from SMF can solve the issue.

Illori

well considering you will not give your exact code or where you want it to go... how do you expect us to help you much? i tested the code they give and it works fine.

Kindred

If you are supposed to put the script in the body section, then you will have to do that....

(and it must be enclosed within echo ' ... '; )

if you are supposed to put it in the head section, then you will have to do that....   

As I said, putting it between </head> and <body> will always fail.
adding it after the <body>'; means that it is now outside the echo...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PLAYBOY

Quoteadding it after the <body>'; means that it is now outside the echo...

Nope. none of these work. I put it before, after, in other lines after echo. I put it between other scripts and echos.
I tried putting it right after /script of another one. with and without ;
nothing worked man

Illori

if you tell us where you want it to show we can tell you where to put it. you cant just put in a random place and expect it to work. if you dont tell us then you can expect me to not help you any longer.

Kindred

and we probably do need to have a look at the ACTUAL script that you are using.... not one pointing to the wrong location
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

PLAYBOY

Quote from: Illori on October 24, 2014, 05:24:49 PM
if you tell us where you want it to show we can tell you where to put it. you cant just put in a random place and expect it to work. if you dont tell us then you can expect me to not help you any longer.

I want it to show on the left top of every page in the forum. So I`m trying to put the script within these codes. Because the button position itself automatically anyways.

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];


echo '
<script type="text/javascript"><!-- // -->','
function capsLock(e, div)
{
keyCode = e.keyCode ? e.keyCode : e.which;
shiftKey = e.shiftKey ? e.shiftKey : ((keyCode === 16) ? true : false);
if (((keyCode >= 65 && keyCode <= 90) && !shiftKey) || ((keyCode >= 97 && keyCode <= 122) && shiftKey))
{
document.getElementById(div).style.visibility = \'visible\';
}
else
{
document.getElementById(div).style.visibility = \'hidden\';
}
}
// ]]','></script>

</head>

<body>
';
}


or

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" />

<link rel="search" href="', $scripturl, '?action=search" />
<link rel="contents" href="', $scripturl, '" />';



I cant give you the website url. I understand you cant do much without the url and I really wish I could but I cant.

So I can give my index.template.php or any other codes from the site you need but I will have to censor specific parts. Above is the code I used. It`s almost the same and only the BTC address is different and the site url. Those little changes in the script shouldnt make any problem as I can use the script on WP and html pages. It works perfectly.

Illori

we did not say your website but the whole code for what you want to add. apparently you cant follow what we say. good luck getting this solved. also where you say you want it and your example are 2 very different places/things.

Advertisement: