<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Google Adsense Archives - Vavai&#039;s Personal Notes</title>
	<atom:link href="https://www.vavai.net/tag/google-adsense/feed/" rel="self" type="application/rss+xml" />
	<link>https://vavai.net/tag/google-adsense/</link>
	<description>Life is our precious gift</description>
	<lastBuildDate>Mon, 11 Jan 2010 21:47:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>How to Add PHP &#038; Javascript Code to Smarty Template (Serendipity, Pligg)</title>
		<link>https://www.vavai.net/how-to-add-php-javascript-code-to-smarty-template-serendipity-pligg/</link>
					<comments>https://www.vavai.net/how-to-add-php-javascript-code-to-smarty-template-serendipity-pligg/#comments</comments>
		
		<dc:creator><![CDATA[Muhammad Rivai]]></dc:creator>
		<pubDate>Mon, 11 Jan 2010 21:47:19 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[SUSE Family]]></category>
		<category><![CDATA[tips]]></category>
		<guid isPermaLink="false">http://v2.vavai.net/?p=1018</guid>

					<description><![CDATA[<p>I manages various website and some of them are running on Serendipity blog engine or a Digg-looks-alike, Pligg. Both engine use Smarty framework based on PHP code. Although Smarty built from PHP engine, it has different style in code writing than another CMS based on PHP like WordPress. Smarty using their own tags that will...</p>
<p>The post <a href="https://www.vavai.net/how-to-add-php-javascript-code-to-smarty-template-serendipity-pligg/">How to Add PHP &#038; Javascript Code to Smarty Template (Serendipity, Pligg)</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="http://v2.vavai.net/wp-content/uploads/2010/01/smarty-logo-orange.gif"><img decoding="async" class="alignleft size-full wp-image-1021" style="margin: 10px;" title="smarty-logo-orange" src="http://v2.vavai.net/wp-content/uploads/2010/01/smarty-logo-orange.gif" alt="" width="250" height="64" /></a>I manages various website and some of them are running on <a href="http://s9y.org">Serendipity blog engine</a> or a Digg-looks-alike, <a href="http://pligg.com">Pligg</a>. Both engine use Smarty framework based on PHP code. Although Smarty built from PHP engine, it has different style in code writing than another CMS based on PHP like WordPress. Smarty using their own tags that will be parsed on their engine, so adding Javascript or PHP code can not be directly written in the related tpl file (an extension for Smarty template).<br />
If you wish to add a Javascript code like Google Adsense or a PHP code into Smarty template, use the following tips :</p>
<ol>
<li>Open your related tpl file and use {php} and {/php} tags to include the PHP file<br />
[code language=&#8217;php&#8217;]<br />
{php}include(&#8216;/home//vavai/vavai.net/myphpfile.php&#8217;);{/php}<br />
[/code]<br />
Please note that I would prefer to use absolute path and not the relative path instead.</li>
<li>Open your related tpl file and use the {literal} and {/literal} tags to add the Javascript code. Place your Javascript code inside literal tags as shown on the following example :<br />
[code language=&#8217;php&#8217;]<br />
{literal}<script type="text/javascript">// <![CDATA[
initializetabcontent("tags_comments")
// ]]&gt;</script>{/literal}<br />
[/code]</li>
</ol>
<p>On the sample #1, I would prefer to include the php file rather than write the PHP code directly on Smarty file. It will make a code a lot easier to manage, clean, easy to understand and we have a flexible way to add or remove the related file.</p>
<p>The post <a href="https://www.vavai.net/how-to-add-php-javascript-code-to-smarty-template-serendipity-pligg/">How to Add PHP &#038; Javascript Code to Smarty Template (Serendipity, Pligg)</a> appeared first on <a href="https://www.vavai.net">Vavai&#039;s Personal Notes</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.vavai.net/how-to-add-php-javascript-code-to-smarty-template-serendipity-pligg/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Object Caching 27/46 objects using Disk
Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: d3b35uem336dgh.cloudfront.net
Lazy Loading (feed)
Minified using Disk
Database Caching 12/32 queries in 0.013 seconds using Disk

Served from: www.vavai.net @ 2026-10-30 17:37:53 by W3 Total Cache
-->