Blog Code Forum

Google Plus One

From Wiki.cyring.fr

(Difference between revisions)
Jump to: navigation, search
(loop.php)
Line 1: Line 1:
 +
== WordPress ==
===== header.php =====
===== header.php =====
-
<syntaxhighlight lang="javascript">
+
<syntaxhighlight lang="html5">
<body <?php body_class(); ?>>
<body <?php body_class(); ?>>
-
...
+
<!-- Google +1 -->
<script type="text/javascript">
<script type="text/javascript">
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="javascript">
window.___gcfg = {lang: '<?php echo qtrans_getLanguage() ?>'};
window.___gcfg = {lang: '<?php echo qtrans_getLanguage() ?>'};
(function() {
(function() {
Line 11: Line 14:
})();
})();
</script>
</script>
-
...
+
...
</syntaxhighlight>
</syntaxhighlight>
 +
----
===== loop.php =====
===== loop.php =====
-
<syntaxhighlight lang="javascript">
+
<syntaxhighlight lang="html5">
<div class="entry-utility">
<div class="entry-utility">
-
...
+
<!-- Google +1 -->
<g:plusone size="small" href="<?php the_permalink(); ?>"></g:plusone>
<g:plusone size="small" href="<?php the_permalink(); ?>"></g:plusone>
...
...
</div><!-- .entry-utility -->
</div><!-- .entry-utility -->
 +
</syntaxhighlight><br />
 +
== MediaWiki ==
 +
===== MonoBook.php =====
 +
<syntaxhighlight lang="html5">
 +
<div id="header">
 +
<!-- Google +1 -->
 +
<script type="text/javascript">
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="javascript">
 +
(function() {
 +
var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
 +
po.src = "https://apis.google.com/js/plusone.js";
 +
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
 +
})();
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="html5">
 +
</script>
 +
</div>
 +
...
 +
<div id="column-content"><div id="content">
 +
<!-- Google +1 -->
 +
<g:plusone size="small" href="<?php echo $this->data[serverurl] . $this->data['content_actions']['nstab-main']['href']; ?>"></g:plusone>
 +
</div></div>
</syntaxhighlight>
</syntaxhighlight>

Revision as of 11:36, 31 December 2012

Contents

WordPress

header.php
<body <?php body_class(); ?>>
	<!-- Google +1 -->
	<script type="text/javascript">
		window.___gcfg = {lang: '<?php echo qtrans_getLanguage() ?>'};
		(function() {
			var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
			po.src = "https://apis.google.com/js/plusone.js";
			var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
		})();
	</script>
...

loop.php
<div class="entry-utility">
	<!-- Google +1 -->
	<g:plusone size="small" href="<?php the_permalink(); ?>"></g:plusone>
	...
</div><!-- .entry-utility -->

MediaWiki

MonoBook.php
<div id="header">
	<!-- Google +1 -->
	<script type="text/javascript">
		(function() {
			var po = document.createElement("script"); po.type = "text/javascript"; po.async = true;
			po.src = "https://apis.google.com/js/plusone.js";
			var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s);
		})();
	</script>
</div>
...
<div id="column-content"><div id="content">
	<!-- Google +1 -->
		<g:plusone size="small" href="<?php echo $this->data[serverurl] . $this->data['content_actions']['nstab-main']['href']; ?>"></g:plusone>
</div></div>
Personal tools