|
Dodawanie przycisku Google +1 do portalu
|
| lukaszartyszuk |
Dodany dnia 03.07.2011 20:53:53
|

Przedszkolak

Postów: 24 Ostrzeżeń: 2
v7.02.04 Data rejestracji: 04.02.2010 17:11
|
Pewnie zauwa?yli?cie, ?e przy wynikach wyszukiwania w Google pojawi?y si? takie ma?e przyciski z plusem. To ma by? odpowied? na facebookowe "Lubi? to".
Taki przycisk, który b?dzie informowa? ile osób "to lubi" "podoba mi si?" mo?na wstawi? na swoj? stron?. Problem w tym, ?e trzeba wklei? dwa kody. Jeden na stron? (domy?lam si? ?e do tre?ci artyku?/newsa" a drugi .. no w?a?nie i tu si? zaczynaj? schody bo nie mam poj?cia, gdzie wklei? ten drugi kod.
Google podpowiada:
Umie?? ten tag w sekcji head lub bezpo?rednio przed zamkni?ciem tagu body:
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
Umie?? ten tag w miejscu, gdzie ma pojawi? si? przycisk +1:
<g:plusone href="www.mojastrona.pl"></g:plusone>
Wi?c moje pytanie, gdzie nale?y wklei? oba kody, tak by przycisk Google+ dzia?a?? U?ywam PHP-Fusion w wersji 7 i stylu SmartBluev2. Je?li mam poda? jeszcze jakie? informacje, to prosz? o wskazówki a zrobi? to niezw?ocznie (w celu unikni?cia usuwania tematu).
Edytowane przez Pieka dnia 03.07.2011 23:32:52
|
| |
|
|
| W?cibski Go?? |
Dodany dnia 26.10.2025 18:10:55
|
Pan Kontekstualny
Postów: n^x
Data rejestracji: Zawsze
|
|
| IP: localhost |
|
|
| emil90ck |
Dodany dnia 03.07.2011 21:02:16
|

Bywalec

Postów: 376 Pomógł: 30 Ostrzeżeń: 3
v7.00.05 Data rejestracji: 25.07.2008 13:11
|
Poni?szy kod wklej w header.php
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
A ten drugi gdzie chcesz np. w panel :P nie sprawdza?em, ale skoro Google tak podaje to musi dzia?a? :D
Nie zapomnij o zmianie " na ' :D
Edytowane przez emil90ck dnia 03.07.2011 21:03:07
|
| |
|
|
| lukaszartyszuk |
Dodany dnia 03.07.2011 21:30:20
|

Przedszkolak

Postów: 24 Ostrzeżeń: 2
v7.02.04 Data rejestracji: 04.02.2010 17:11
|
Wpisuj? to do pliku header.php, lecz nie bardzo wiem w którym miejscu. Próbowa?em w kilku miejscach i wyskakuje b??d.
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: header.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
require_once INCLUDES."output_handling_include.php";
require_once INCLUDES."header_includes.php";
require_once THEME."theme.php";
if ($settings['maintenance'] == "1" && ((iMEMBER && $settings['maintenance_level'] == "1" && $userdata['user_id'] != "1") || ($settings['maintenance_level'] > $userdata['user_level']))) { redirect(BASEDIR."maintenance.php"); }
if (iMEMBER) { $result = dbquery("UPDATE ".DB_USERS." SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'"); }
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";
echo "<head>\n<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<link rel='stylesheet' href='".THEME."styles.css' type='text/css' media='screen' />\n";
if (file_exists(IMAGES."favicon.ico")) { echo "<link rel='shortcut icon' href='".IMAGES."favicon.ico' type='image/x-icon' />\n"; }
if (function_exists("get_head_tags")) { echo get_head_tags(); }
echo "<script type='text/javascript' src='".INCLUDES."jscript.js'></script>\n";
echo "<script type='text/javascript' src='".INCLUDES."jquery.js'></script>\n";
echo "</head>\n<body>\n";
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
require_once THEMES."templates/panels.php";
ob_start();
?>
B??d:
Parse error: syntax error, unexpected '<' in /home/zasmach/domains/rppp.pl/public_html/themes/templates/header.php on line 39
Trzeba usun??, nawias czy jak? |
| |
|
|
| emil90ck |
Dodany dnia 03.07.2011 21:35:47
|

Bywalec

Postów: 376 Pomógł: 30 Ostrzeżeń: 3
v7.00.05 Data rejestracji: 25.07.2008 13:11
|
Ca?o?? musisz wzi?? w echo :P
Poni?ej gotowiec :)
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: header.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
require_once INCLUDES."output_handling_include.php";
require_once INCLUDES."header_includes.php";
require_once THEME."theme.php";
if ($settings['maintenance'] == "1" && ((iMEMBER && $settings['maintenance_level'] == "1" && $userdata['user_id'] != "1") || ($settings['maintenance_level'] > $userdata['user_level']))) { redirect(BASEDIR."maintenance.php"); }
if (iMEMBER) { $result = dbquery("UPDATE ".DB_USERS." SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'"); }
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";
echo "<head>\n<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<link rel='stylesheet' href='".THEME."styles.css' type='text/css' media='screen' />\n";
if (file_exists(IMAGES."favicon.ico")) { echo "<link rel='shortcut icon' href='".IMAGES."favicon.ico' type='image/x-icon' />\n"; }
if (function_exists("get_head_tags")) { echo get_head_tags(); }
echo "<script type='text/javascript' src='".INCLUDES."jscript.js'></script>\n";
echo "<script type='text/javascript' src='".INCLUDES."jquery.js'></script>\n";
echo "<script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>\n"
echo "</head>\n<body>\n";
require_once THEMES."templates/panels.php";
ob_start();
?>
Edytowane przez emil90ck dnia 03.07.2011 21:47:33
|
| |
|
|
| Borek |
Dodany dnia 03.07.2011 21:40:31
|

Bywalec

Postów: 399 Pomógł: 64
v7.02.05 Data rejestracji: 28.06.2009 19:38
|
Usu? <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
, ?eby Ci si? nie miesza?o. Ca?o?? b?dzie taka:
<?php
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: header.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
require_once INCLUDES."output_handling_include.php";
require_once INCLUDES."header_includes.php";
require_once THEME."theme.php";
if ($settings['maintenance'] == "1" && ((iMEMBER && $settings['maintenance_level'] == "1" && $userdata['user_id'] != "1") || ($settings['maintenance_level'] > $userdata['user_level']))) { redirect(BASEDIR."maintenance.php"); }
if (iMEMBER) { $result = dbquery("UPDATE ".DB_USERS." SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'"); }
echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>\n";
echo "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='".$locale['xml_lang']."' lang='".$locale['xml_lang']."'>\n";
echo "<head>\n<title>".$settings['sitename']."</title>\n";
echo "<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."' />\n";
echo "<meta name='description' content='".$settings['description']."' />\n";
echo "<meta name='keywords' content='".$settings['keywords']."' />\n";
echo "<link rel='stylesheet' href='".THEME."styles.css' type='text/css' media='screen' />\n";
if (file_exists(IMAGES."favicon.ico")) { echo "<link rel='shortcut icon' href='".IMAGES."favicon.ico' type='image/x-icon' />\n"; }
if (function_exists("get_head_tags")) { echo get_head_tags(); }
echo "<script type='text/javascript' src='".INCLUDES."jscript.js'></script>\n";
echo "<script type='text/javascript' src='".INCLUDES."jquery.js'></script>\n";
echo "<script type='text/javascript' src='https://apis.google.com/js/plusone.js'></script>\n"
echo "</head>\n<body>\n";
require_once THEMES."templates/panels.php";
ob_start();
?>
Nie pomagam przez GG, PW itp. Tylko tutaj.

|
| |
|
|
| lukaszartyszuk |
Dodany dnia 03.07.2011 21:42:33
|

Przedszkolak

Postów: 24 Ostrzeżeń: 2
v7.02.04 Data rejestracji: 04.02.2010 17:11
|
Dzia?a :) Wielkie dzi?ki. Musia?em jedynie usun?? linijk?:
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
Bo si? powtórzy?a na ko?cu i powodowa?a b??d. |
| |
|