From 2a2457201ca94e0109f2e8fceee9dc25bf220f62 Mon Sep 17 00:00:00 2001
From: mattpiwik <matthieu.aubry@gmail.com>
Date: Sun, 13 Feb 2011 00:19:07 +0000
Subject: [PATCH] Fixing Tests & Help message

git-svn-id: http://dev.piwik.org/svn/trunk@3877 59fd770c-687e-43c8-a1e3-f5a4ff64c105
---
 plugins/Referers/Controller.php                    | 14 ++++++++++----
 ...ts__CoreAdminHome.getKnownSegmentsToArchive.xml |  2 ++
 ...rt__CoreAdminHome.getKnownSegmentsToArchive.xml |  2 ++
 ...it__CoreAdminHome.getKnownSegmentsToArchive.xml |  2 ++
 4 files changed, 16 insertions(+), 4 deletions(-)
 create mode 100644 tests/integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml
 create mode 100644 tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CoreAdminHome.getKnownSegmentsToArchive.xml
 create mode 100644 tests/integration/expected/test_noVisit__CoreAdminHome.getKnownSegmentsToArchive.xml

diff --git a/plugins/Referers/Controller.php b/plugins/Referers/Controller.php
index 3b14db1649..c8b3f02fef 100644
--- a/plugins/Referers/Controller.php
+++ b/plugins/Referers/Controller.php
@@ -376,7 +376,7 @@ function DisplayTopKeywords($url = "")
 		This widget makes it easy to use Piwik to <i>automatically display the list of Top Keywords</i>, for each of your website Page URLs.</p>
 		<p>
 		<b>Example API URL</b> - For example if you would like to get the top 10 keywords, used last week, to land on the page <a target='_blank' href='$topPageUrl'>$topPageUrl</a>,
-		in format JSON: you would dynamically fetch the data <a target='_blank' href='$jsonRequest&url=".urlencode($topPageUrl)."'>this API request Url</a>. Make sure you encode the 'url' parameter in the URL.</p> 
+		in format JSON: you would dynamically fetch the data using <a target='_blank' href='$jsonRequest&url=".urlencode($topPageUrl)."'>this API request URL</a>. Make sure you encode the 'url' parameter in the URL.</p> 
 		
 		<p><b>PHP Function ready to use!</b> - If you use PHP on your website, we have prepared a small code snippet that you can copy paste in your Website PHP files. You can then simply call the function <code>DisplayTopKeywords();</code> anywhere in your template, at the bottom of the content or in your blog sidebar. 
 		If you run this code in your page $topPageUrl, it would output the following:";
@@ -384,11 +384,17 @@ function DisplayTopKeywords($url = "")
 		echo "<div style='width:400px;margin-left:20px;padding:10px;border:1px solid black;'>";
 		eval($code);
 		DisplayTopKeywords($topPageUrl);
-		echo "</div>
+		
+		echo "</div><br/>
+		<p>Here is the PHP function that you can paste in your pages:</P>
+		<textarea cols=60 rows=8>&lt;?php\n" . htmlspecialchars($code) . "\n DisplayTopKeywords();</textarea>
 		";
 		
-		echo "<br/><p>Here is the PHP function that you can paste in your pages:</P>
-		<textarea cols=60 rows=8>&lt;?php\n" . htmlspecialchars($code) . "\n DisplayTopKeywords();</textarea>";
+		echo "
+		<p><b>Notes</b>: You can for example edit the code to to make the Top search keywords link to your Website search result pages. 
+		<br/>On medium to large traffic websites, we recommend to cache this data, as to minimize the performance impact of calling the Piwik API on each page view.
+		</p> 
+		";
 				
 	}
 	
diff --git a/tests/integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml b/tests/integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml
new file mode 100644
index 0000000000..c234bed59e
--- /dev/null
+++ b/tests/integration/expected/test_OneVisitorTwoVisits__CoreAdminHome.getKnownSegmentsToArchive.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result />
\ No newline at end of file
diff --git a/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CoreAdminHome.getKnownSegmentsToArchive.xml b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CoreAdminHome.getKnownSegmentsToArchive.xml
new file mode 100644
index 0000000000..c234bed59e
--- /dev/null
+++ b/tests/integration/expected/test_OneVisitorTwoVisits_withCookieSupport__CoreAdminHome.getKnownSegmentsToArchive.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result />
\ No newline at end of file
diff --git a/tests/integration/expected/test_noVisit__CoreAdminHome.getKnownSegmentsToArchive.xml b/tests/integration/expected/test_noVisit__CoreAdminHome.getKnownSegmentsToArchive.xml
new file mode 100644
index 0000000000..c234bed59e
--- /dev/null
+++ b/tests/integration/expected/test_noVisit__CoreAdminHome.getKnownSegmentsToArchive.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result />
\ No newline at end of file
-- 
GitLab