main.tpl in code

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

main.tpl in code

Post by aa123aa »

use 2.6.9

i want to in main.tpl add code,but show :
{writeNewsHeader}{writeNewsRSS}
{writeNews}
{showAllNews}

{writeNumberOfArticles}

but it can't run show it. why? i only want to index.php first show the code, not in every page. how to do it?
i want to add js code or flash code or other Slider code , let the main.tpl is good.
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: main.tpl in code

Post by Thorsten »

Hi,

I don't understand what you want to do exactly...

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

Re: main.tpl in code

Post by aa123aa »

1.internal links in 2.6.9 is can't use, and it can use auto keywords? for example,i add keywords A ,and the link is http://www.A.com, when the content have A in it , it can auto linking http://www.A.com, it doesn't add internal links ,it is auto . so, i would link use the file list to save all the internal links ,so that it can run auto .

2. i want to in main.tpl add code, javascript code and so on,
for example: javascript code in it , like it or other code, but it can't run show it. why?
it run wrong.


3. i add a article content ,i want to auto active, not immediately active.i set the active time after 2 days when it auto active, if the time doesn't 2 days, i doesn't active and can't show in the website. i think it is the good seo for auto active content. how to do it?
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

Re: main.tpl in code

Post by aa123aa »

in the main.tpl can't use javascript?
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

Re: main.tpl in code

Post by aa123aa »

for example, i copy google adsence code in it , but so me the wrong :

<script type="text/javascript"><!--
google_ad_client = "pub-6610622721040810";
/* 468x15, 创建于 10-10-21 */
google_ad_slot = "0741294422";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

it show :
{writeNewsHeader}{writeNewsRSS}
{writeNews}
{showAllNews}

{writeNumberOfArticles}
there can't run . how to add code in the main.tpl.
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: main.tpl in code

Post by Thorsten »

Hi,

what's happening when you're doing this? You can add JS code in templates.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

Re: main.tpl in code

Post by aa123aa »

when add js code in mail.tpl


<script type="text/javascript" src="inc/js/suggest.js"></script>

<!-- Instant Response -->
<div id="instantresponse">

</div>

<img src="images/seo-blocks.gif" alt="seo" />

<script type="text/javascript"><!--
google_ad_client = "pub-6610622721040810";
/* 468x15, 创建于 10-10-21 */
google_ad_slot = "0741294422";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<!-- News -->
<div id="news">
<h2>{writeNewsHeader}{writeNewsRSS}</h2>
{writeNews}
<p>{showAllNews}</p>
<p align="center">{writeNumberOfArticles}</p>
</div>

that is all my main.tpl code.
but it run:
the picture:

you can see the add img picture is ok , and the js code is ok .but it make other show wrong.
{writeNewsHeader}{writeNewsRSS}
{writeNews}
{showAllNews}
{writeNumberOfArticles}
there are can't run .

can you get me the add google js code in main.tpl file to me ? how to add code and no make the wrong?
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: main.tpl in code

Post by Thorsten »

Hi,

I tested it and it doesn't break anything for me. Even the JS code looks good.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

Re: main.tpl in code

Post by aa123aa »

Thorsten wrote:Hi,

I tested it and it doesn't break anything for me. Even the JS code looks good.

bye
Thorsten

can you show me your main.tpl all code and the picture?
i have try to do it but it is back.
use chinese language .
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: main.tpl in code

Post by Thorsten »

Hi,

I just copied your code into main.tpl. The image doesn't appeared, but all template variables were parsed.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
aa123aa
Posts: 27
Joined: Sat Apr 03, 2010 1:33 pm

Re: main.tpl in code

Post by aa123aa »

Thorsten wrote:Hi,

I just copied your code into main.tpl. The image doesn't appeared, but all template variables were parsed.

bye
Thorsten
i think the template variable you changed the php file for it .
if you use the download 2.69 , adn install it ,you will see my question.
i am waiting for your answer.
thank you.
Post Reply