| Webmaster Revenue Discuss money making strategies and ideas. Includes AdSense, YPN and affiliate programs. |
01-04-2008, 05:14 AM
|
#1 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
I need Help for Kontera
Please how do i add kontera in text link to my forum posts? I'm using SMF defaut theme. Thanks.
|
|
|
01-04-2008, 06:20 AM
|
#2 (permalink)
|
|
Contributing Member
Join Date: 07-06-07
Location: Phoenix, Arizona
Posts: 503
|
welcome to V7N.
|
|
|
01-04-2008, 06:28 AM
|
#3 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
Can you help me out?
|
|
|
01-05-2008, 12:45 PM
|
#4 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
Quote:
Originally Posted by Bob8
Please how do i add kontera in text link to my forum posts? I'm using SMF defaut theme. Thanks.
|
Since you are dealing with js, it is more effective to use an 'include' with SMF since everything is inside a PHP block.
You need to edit the index.template.php file that goes with the theme you use.
Find the place where </body> is produced from and add the code above that point.
include("mykontera.inc");
Prepare a text file called mykontera.inc and paste in the code from Kontera. Save and upload to the site, same theme folder.
This works well for statcounter js as well.
Editing the default theme is not advisable. Make a copy for b/u or create a new theme based on the default.
Remeber to b/u your tables before you edit any templates. Everytime!
Let me know and holler if you need more info...
J
Last edited by jdspc : 01-05-2008 at 12:49 PM.
Reason: More advice on editing the theme...
|
|
|
01-05-2008, 01:18 PM
|
#5 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
Pls i don't understand, how do i upload the kontera code into the default theme, can i copy and paste? thanks.
|
|
|
01-05-2008, 01:39 PM
|
#6 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
Paste your code into a .txt file and name it mykontera.inc
Upload this txt file to the themes root folder. I like to use SmartFTP.
Then, in the index.template.php file insert this line just above the </body> tag (somewhere around line 500 depending)
include("mykontera.inc")
In the layout and themes section in the admin is where you modify your templates.
If you have never done this I highly recommend that you read some docs at the smf forum. They have a very nice tutorial, if you will, concerning editing templates. Much better than I can explain.
But again, make a copy of the theme.
I am more than happy to assist you if you need more help though.
J
|
|
|
01-05-2008, 01:48 PM
|
#7 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
I'm using frontpage to publish my site, so i always do the modifications and editing through my frontpage remote panel, I already open the index.template.php file in my frontpage remote panel what next should i do?
|
|
|
01-05-2008, 01:56 PM
|
#8 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
Find the </body> tag and above it, insert the line
include("mykontera.inc")
Then upload the txt file you created, "mykontera.inc", along with it.
Should fly..
|
|
|
01-05-2008, 03:45 PM
|
#9 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
Quote:
Originally Posted by jdspc
Find the </body> tag and above it, insert the line
include("mykontera.inc")
Then upload the txt file you created, "mykontera.inc", along with it.
Should fly..
|
Let me add - the line should read
include("mykontera.inc");
|
|
|
01-05-2008, 04:14 PM
|
#10 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
I give up because it's crashing my forum. I believe the code should be added to the display template.
|
|
|
01-05-2008, 04:17 PM
|
#11 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
What kind of error msg are you getting?
|
|
|
01-05-2008, 04:23 PM
|
#12 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
Man that's great, i could see that it work on your forum.
|
|
|
01-05-2008, 04:24 PM
|
#13 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
I was trying to add kontera code directly to my index template.
|
|
|
01-05-2008, 04:35 PM
|
#14 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
Quote:
Originally Posted by Bob8
I was trying to add kontera code directly to my index template.
|
If you go that route, you have to take pains to escape the js parenthesis and that will cause trouble. Thus the include method.
|
|
|
01-05-2008, 04:46 PM
|
#15 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
I have upload the kontera file into the index template still nothing shows.
|
|
|
01-05-2008, 05:35 PM
|
#16 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
uploaded to the forum root folder?
|
|
|
01-05-2008, 05:41 PM
|
#17 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
What is the name of the root folder?
|
|
|
01-05-2008, 05:43 PM
|
#18 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
Because i do upload it already to the defaut theme folder.
|
|
|
01-05-2008, 06:08 PM
|
#19 (permalink)
|
|
Contributing Member
Join Date: 01-04-08
Location: France
Posts: 62
Latest Blog: None
|
Can you pls copy and paste your forum index template code </body> tag code with the "mykontera.inc" and post it here so that i see how it look. Maybe that will help me, thanks.
|
|
|
01-05-2008, 10:17 PM
|
#20 (permalink)
|
|
v7n Mentor
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 1,065
|
Each index.template.php will vary according to the mods installed but..
on mine starting at line 471 is the following;
Look for a comment with
Code:
// Unfortunately, Safari does not have...
scroll down and insert the line
Code:
include("mykontera.inc");
after the last </div> before the comment on AJAX (see below)
PHP Code:
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}';
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
echo '
// ]]></script>';
}
echo '
</div>';
include("mykontera.inc");
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</body></html>';
}
Then upload the file you made earlier containing the kontera js that you named mykontera.inc to the folder of your theme...ie themes/default
This is the easiest method.
Let me know and holler with any questions.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|