how to insert a javascript between the question and answer

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
panaceapeace
Posts: 10
Joined: Mon Sep 19, 2005 6:29 pm

how to insert a javascript between the question and answer

Post by panaceapeace »

Hi

i tried inserting java script code between the question and answer by inserting the code in artikel.tpl file. Instead of end content the javascript code itself gets displayed. Where iam went wrong? Is there is any other way to do it?

TIA

with rgds,
Abhisek
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

how did you inserted it?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
panaceapeace
Posts: 10
Joined: Mon Sep 19, 2005 6:29 pm

i need to insert a javascript code in between question and

Post by panaceapeace »

Hi

Thanks for the quick reply.

I need to insert a javascript code in between question and answer. I found artikel.tpl inthe template folder which is displaying the question and answer so i inserted the java script code there assuming that equivalent javascript content will be get displayed there.

Instead of the content javascript itself get displayed there?

How to over come this?
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

please paste your article.tpl code here in the forum.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
panaceapeace
Posts: 10
Joined: Mon Sep 19, 2005 6:29 pm

code in my airtikel.tpl

Post by panaceapeace »

<h2 id="article_category">{writeRubrik}</h2>
<h2>{writeThema}</h2>
<!-- Article -->
<p>{writeContent}</p>
<!-- /Article -->
<p>{writeDateMsg}<br />
{writeAuthor}</p>
<p>
<script type="text/javascript"><!--
google_ad_client = "pub-xx";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text";
google_ad_channel ="xx";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000FF";
google_color_url = "000000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
{switchLanguage}
<p id="action">
<img src="images/print.gif" alt="{writePrintMsgTag}" title="{writePrintMsgTag}" width="16" height="16" border="0" /> {writePrintMsg}<br />
<img src="images/email.gif" alt="{writeSend2FriendMsgTag}" title="{writeSend2FriendMsgTag}" width="16" height="16" border="0" /> {writeSend2FriendMsg}<br />
<img src="images/pdf.gif" alt="{writePDFTag}" title="{writePDFTag}" width="16" height="16" border="0" /> {writePDF}<br />
<img src="images/xml.gif" alt="{writeXMLMsgTag}" title="{writeXMLMsgTag}" width="24" height="16" border="0" /> {writeXMLMsg}
</p>

<!-- Voting Form -->
<form action="{saveVotingPATH}" method="post" style="display: inline;">
<fieldset>
<legend>{msgVoteUseability}</legend>
<input type="hidden" name="artikel" value="{saveVotingID}" />
<input type="hidden" name="userip" value="{saveVotingIP}" />
<p align="center"><strong>{msgAverageVote}</strong> {printVotings}</p>
<p align="center">{msgVoteBad}
<input class="radio" type="radio" name="vote" value="1" /> 1
<input class="radio" type="radio" name="vote" value="2" /> 2
<input class="radio" type="radio" name="vote" value="3" /> 3
<input class="radio" type="radio" name="vote" value="4" /> 4
<input class="radio" type="radio" name="vote" value="5" /> 5
{msgVoteGood}<br />
<input class="submit" type="submit" name="submit" value="{msgVoteSubmit}" />
</p>
</fieldset>
</form>
<!-- /Voting Form -->

<p>{writeCommentMsg}</p>
{writeComments}
Thorsten
Posts: 15834
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

IE6 displays the Google Ads, Firefox blocks them with Adblock. :-)

It works for me.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
panaceapeace
Posts: 10
Joined: Mon Sep 19, 2005 6:29 pm

Now its working fine

Post by panaceapeace »

Thank you for your support.

Now the code is working fine, some time google bot takes time to display ads on new location. May be this could be the reason why it didnt show ads earlier.
Post Reply