phpBB

Development Wiki

Difference between revisions of "User:BarryCarlyon/Ubiquity"

From phpBB Development Wiki

m (Helps to read the ubiquity docs)
m (*thinks he needs to do the wiki seminar _again_* ;))
 
Line 1: Line 1:
<h2>Search phpBB.com Using Ubiquity</h2>
+
==Search phpBB.com Using Ubiquity==
  
  
Line 41: Line 41:
 
Command for ubiquity is phpbb Words
 
Command for ubiquity is phpbb Words
  
<h2>Search the Wiki</h2>
+
==Search the Wiki==
  
 
Use this code instead, command for ubiquity is phpbb-wiki Words
 
Use this code instead, command for ubiquity is phpbb-wiki Words
Line 50: Line 50:
 
   url: "http://wiki.phpbb.com/Special:Search?search={QUERY}&fulltext=Search",
 
   url: "http://wiki.phpbb.com/Special:Search?search={QUERY}&fulltext=Search",
 
   icon: "http://www.phpBB.com/favicon.ico",
 
   icon: "http://www.phpBB.com/favicon.ico",
   description: 'Searches the <a href="http://wikiphpbb.com/">phpBB wiki</a> for your words.',
+
   description: 'Searches the <a href="http://wiki.phpbb.com/">phpBB wiki</a> for your words.',
 
   help: 'Found Here: <a href="http://wiki.phpbb.com/User:BarryCarlyon/Ubiquity">phpBB Wiki</a>',
 
   help: 'Found Here: <a href="http://wiki.phpbb.com/User:BarryCarlyon/Ubiquity">phpBB Wiki</a>',
 
   preview: function(pblock, directObject) {
 
   preview: function(pblock, directObject) {

Latest revision as of 02:54, 31 August 2008

Search phpBB.com Using Ubiquity

Ubiquity is a Experimental Firefox Extension: Ubiquity on Mozilla Labs, its adds Mac Quicksilver functionality to Firefox.

Add Searching phpBB.com Forums to Ubiquity, Powered by Google, When using Ubiquity it previews the search results too!

1) Visit chrome://ubiquity/content/editor.html - Ubiquity User Command Editor, in Your Browser

2) Copy and Paste the Following into the TextArea

makeSearchCommand({
  name: "phpBB",
  url: "http://www.phpbb.com/search/?q={QUERY}",
  icon: "http://www.phpBB.com/favicon.ico",
  description: 'Searches <a href="http://phpbb.com/">phpBB</a> for your words.',
  help: 'Found Here: <a href="http://wiki.phpbb.com/User:BarryCarlyon/Ubiquity">phpBB Wiki</a>',
  preview: function(pblock, directObject) {
    var searchTerm = directObject.text;
    var pTemplate = "Searches phpBB for <b>${query}</b>";
    var pData = {query: searchTerm};
    pblock.innerHTML = CmdUtils.renderTemplate(pTemplate, pData);

    var url = "http://ajax.googleapis.com/ajax/services/search/web";
    var params = { v: "1.0", q: "site:phpbb.com " + searchTerm };

    jQuery.get( url, params, function(data) {
      var numToDisplay = 3;
      var results = data.responseData.results.splice( 0, numToDisplay );

      pblock.innerHTML = CmdUtils.renderTemplate( {file:"google-search.html"},
						  {results:results}
						);
      }, "json");
  }
});

3) Test it, The Editor Saves Automagically! Command for ubiquity is phpbb Words

Search the Wiki

Use this code instead, command for ubiquity is phpbb-wiki Words

makeSearchCommand({
  name: "phpBB-Wiki",
  url: "http://wiki.phpbb.com/Special:Search?search={QUERY}&fulltext=Search",
  icon: "http://www.phpBB.com/favicon.ico",
  description: 'Searches the <a href="http://wiki.phpbb.com/">phpBB wiki</a> for your words.',
  help: 'Found Here: <a href="http://wiki.phpbb.com/User:BarryCarlyon/Ubiquity">phpBB Wiki</a>',
  preview: function(pblock, directObject) {
    var searchTerm = directObject.text;
    var pTemplate = "Searches phpBB wiki for <b>${query}</b>";
    var pData = {query: searchTerm};
    pblock.innerHTML = CmdUtils.renderTemplate(pTemplate, pData);

    var url = "http://ajax.googleapis.com/ajax/services/search/web";
    var params = { v: "1.0", q: "site:wiki.phpbb.com " + searchTerm };

    jQuery.get( url, params, function(data) {
      var numToDisplay = 3;
      var results = data.responseData.results.splice( 0, numToDisplay );

      pblock.innerHTML = CmdUtils.renderTemplate( {file:"google-search.html"},
						  {results:results}
						);
      }, "json");
  }
});

BarryCarlyon 01:42, 31 August 2008 (UTC)