diff --git a/lib/common/models/wp_version.rb b/lib/common/models/wp_version.rb index 75023e81..ae7eab4f 100755 --- a/lib/common/models/wp_version.rb +++ b/lib/common/models/wp_version.rb @@ -16,4 +16,11 @@ class WpVersion < WpItem # @return [ Array ] def allowed_options; super << :number << :found_from end + # @param [ WpVersion ] other + # + # @return [ Boolean ] + def ==(other) + number == other.number + end + end diff --git a/lib/common/models/wp_version/findable.rb b/lib/common/models/wp_version/findable.rb index d11e8be6..df71f65c 100755 --- a/lib/common/models/wp_version/findable.rb +++ b/lib/common/models/wp_version/findable.rb @@ -3,32 +3,46 @@ class WpVersion < WpItem module Findable - @@version_xml = WP_VERSIONS_FILE - def version_xml - @@version_xml - end - - def version_xml=(xml) - if File.exists?(xml) - @@version_xml = xml - else - raise "The file #{xml} does not exist" - end - end - - # Find the version of the wp_target blog - # returns a WpVersion object or nil - def find(target_uri, wp_content_dir, wp_plugins_dir) + # Find the version of the blog designated from target_uri + # + # @param [ URI ] target_uri + # @param [ String ] wp_content_dir + # @param [ String ] wp_plugins_dir + # + # @return [ WpVersion ] + def find(target_uri, wp_content_dir, wp_plugins_dir, versions_xml) methods.grep(/find_from_/).each do |method| - if version = send(method, target_uri, wp_content_dir, wp_plugins_dir) + if method === :find_from_advanced_fingerprinting + version = send(method, target_uri, wp_content_dir, wp_plugins_dir, versions_xml) + else + version = send(method, target_uri) + end + + if version return new(target_uri, number: version, found_from: method) end end + nil end + # Used to check if the version is correct: must contain at least one dot. + # + # @return [ String ] + def version_pattern + '([^\r\n"\']+\.[^\r\n"\']+)' + end + + protected + # Returns the first match of in the body of the url + # + # @param [ URI ] target_uri + # @param [ Regex ] pattern + # @param [ String ] path + # + # @return [ String ] def scan_url(target_uri, pattern, path = nil) url = path ? target_uri.merge(path).to_s : target_uri.to_s response = Browser.instance.get_and_follow_location(url) @@ -47,7 +61,11 @@ class WpVersion < WpItem # # The meta tag can be removed however it seems, # that it is reinstated on upgrade. - def find_from_meta_generator(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_meta_generator(target_uri) scan_url( target_uri, %r{name="generator" content="wordpress #{version_pattern}"}i @@ -56,7 +74,11 @@ class WpVersion < WpItem # Attempts to find the WordPress version from, # the generator tag in the RSS feed source. - def find_from_rss_generator(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_rss_generator(target_uri) scan_url( target_uri, %r{http://wordpress.org/\?v=#{version_pattern}}i, @@ -66,7 +88,11 @@ class WpVersion < WpItem # Attempts to find WordPress version from, # the generator tag in the RDF feed source. - def find_from_rdf_generator(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_rdf_generator(target_uri) scan_url( target_uri, %r{}i, @@ -78,7 +104,7 @@ class WpVersion < WpItem # the generator tag in the RSS2 feed source. # # Have not been able to find an example of this - Ryan - #def find_from_rss2_generator(target_uri, wp_content_dir, wp_plugins_dir) + #def find_from_rss2_generator(target_uri) # scan_url( # target_uri, # %r{http://wordpress.org/?v=(#{WpVersion.version_pattern})}i, @@ -88,7 +114,11 @@ class WpVersion < WpItem # Attempts to find the WordPress version from, # the generator tag in the Atom source. - def find_from_atom_generator(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_atom_generator(target_uri) scan_url( target_uri, %r{WordPress}i, @@ -100,7 +130,7 @@ class WpVersion < WpItem # the generator tag in the comment rss source. # # Have not been able to find an example of this - Ryan - #def find_from_comments_rss_generator(target_uri, wp_content_dir, wp_plugins_dir) + #def find_from_comments_rss_generator(target_uri) # scan_url( # target_uri, # %r{}i, @@ -115,10 +145,17 @@ class WpVersion < WpItem # # /!\ Warning : this method might return false positive if the file used for fingerprinting is part of a theme (they can be updated) # - def find_from_advanced_fingerprinting(target_uri, wp_content_dir, wp_plugins_dir) - xml = xml(version_xml) + # @param [ URI ] target_uri + # @param [ String ] wp_content_dir + # @param [ String ] wp_plugins_dir + # @param [ String ] versions_xml The path to the xml containing all versions + # + # @return [ String ] The version number + def find_from_advanced_fingerprinting(target_uri, wp_content_dir, wp_plugins_dir, versions_xml) + xml = xml(versions_xml) + # This wp_item will take care of encoding the path - # and replace variables like $wp-content$ and $wp-plugins$ + # and replace variables like $wp-content$ & $wp-plugins$ wp_item = WpItem.new(target_uri, wp_content_dir: wp_content_dir, wp_plugins_dir: wp_plugins_dir) @@ -139,7 +176,11 @@ class WpVersion < WpItem end # Attempts to find the WordPress version from the readme.html file. - def find_from_readme(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_readme(target_uri) scan_url( target_uri, %r{
\sversion #{version_pattern}}i, @@ -150,7 +191,11 @@ class WpVersion < WpItem # Attempts to find the WordPress version from the sitemap.xml file. # # See: http://code.google.com/p/wpscan/issues/detail?id=109 - def find_from_sitemap_generator(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_sitemap_generator(target_uri) scan_url( target_uri, %r{generator="wordpress/#{version_pattern}"}i, @@ -159,7 +204,11 @@ class WpVersion < WpItem end # Attempts to find the WordPress version from the p-links-opml.php file. - def find_from_links_opml(target_uri, wp_content_dir, wp_plugins_dir) + # + # @param [ URI ] target_uri + # + # @return [ String ] The version number + def find_from_links_opml(target_uri) scan_url( target_uri, %r{generator="wordpress/#{version_pattern}"}i, @@ -167,10 +216,5 @@ class WpVersion < WpItem ) end - # Used to check if the version is correct: must contain at least one dot. - def version_pattern - '([^\r\n"\']+\.[^\r\n"\']+)' - end - end end diff --git a/lib/common/models/wp_version/vulnerable.rb b/lib/common/models/wp_version/vulnerable.rb index 0ab7d818..dc2b5dd0 100644 --- a/lib/common/models/wp_version/vulnerable.rb +++ b/lib/common/models/wp_version/vulnerable.rb @@ -3,6 +3,7 @@ class WpVersion < WpItem module Vulnerable + # @return [ String ] The path to the file containing vulnerabilities def vulns_file unless @vulns_file @vulns_file = WP_VULNS_FILE @@ -10,6 +11,7 @@ class WpVersion < WpItem @vulns_file end + # @return [ String ] def vulns_xpath "//wordpress[@version='#{@number}']/vulnerability" end diff --git a/lib/wpscan/wp_target.rb b/lib/wpscan/wp_target.rb index 79d5bdc2..3c9522c6 100644 --- a/lib/wpscan/wp_target.rb +++ b/lib/wpscan/wp_target.rb @@ -86,9 +86,11 @@ class WpTarget < WebSite WpTheme.find(@uri) end - # return WpVersion - def version - WpVersion.find(@uri, wp_content_dir, wp_plugins_dir) + # @param [ String ] versions_xml + # + # @return [ WpVersion ] + def version(versions_xml) + WpVersion.find(@uri, wp_content_dir, wp_plugins_dir, versions_xml) end def has_plugin?(name, version = nil) diff --git a/main.rb b/main.rb index 552c6d24..f5fff852 100644 --- a/main.rb +++ b/main.rb @@ -169,7 +169,7 @@ def main exclude_content: wpscan_options.exclude_content_based } - if wp_version = wp_target.version + if wp_version = wp_target.version(WP_VERSIONS_FILE) wp_version.output end diff --git a/spec/lib/common/models/wp_version/findable_spec.rb b/spec/lib/common/models/wp_version/findable_spec.rb new file mode 100644 index 00000000..35395f76 --- /dev/null +++ b/spec/lib/common/models/wp_version/findable_spec.rb @@ -0,0 +1,202 @@ +# encoding: UTF-8 + +require 'spec_helper' + +describe 'WpVersion::Findable' do + let(:fixtures_dir) { MODELS_FIXTURES + '/wp_version/findable/' } + let(:uri) { URI.parse('http://example.com/') } + let(:generator_urls) { + { + rss_generator: uri.merge('feed/').to_s, + rdf_generator: uri.merge('feed/rdf/').to_s, + atom_generator: uri.merge('feed/atom/').to_s, + comments_rss_generator: uri.merge('comments/feed/').to_s, + sitemap_generator: uri.merge('sitemap.xml').to_s + } + } + + # Dynamic creation for all generator methods + WpVersion.methods.grep(/^find_from_.*_generator$/).each do |method| + dir_name = method.to_s[%r{^find_from_(.*)$}, 1] + + describe "::#{method}" do + let(:url) { generator_urls[dir_name.to_sym] || uri.to_s } + + after do + fixture = fixtures_dir + dir_name + @fixture + stub_request_to_fixture(url: url, fixture: fixture) + + WpVersion.send(method, uri).should == @expected + end + + context 'when generator not found' do + it 'returns nil' do + @fixture = '/no_generator.html' + @expected = nil + end + end + + context 'when version not found' do + it 'returns nil' do + @fixture = '/no_version.html' + @expected = nil + end + end + + context 'when invalid version' do + it 'returns nil' do + @fixture = '/invalid_version.html' + @expected = nil + end + end + + it 'returns 3.3.2' do + @fixture = '/3.3.2.html' + @expected = '3.3.2' + end + + it 'returns 3.4-beta4' do + @fixture = '/3.4-beta4.html' + @expected = '3.4-beta4' + end + + if method == :find_from_meta_generator + it 'returns 3.5' do + @fixture = '/3.5_minified.html' + @expected = '3.5' + end + end + + end + end + + describe '::find_from_advanced_fingerprinting' do + let(:fixture_dir) { fixtures_dir + 'advanced_fingerprinting/' } + let(:wp_content_dir) { 'wp-content' } + let(:wp_plugins_dir) { wp_content_dir + '/plugins' } + let(:versions_xml) { fixture_dir + 'wp_versions.xml' } + + after do + version = WpVersion.send( + :find_from_advanced_fingerprinting, + uri, wp_content_dir, wp_plugins_dir, versions_xml + ) + version.should == @expected + end + + context 'when' do + it 'returns nil' do + stub_request(:get, /.*/).to_return(status: 404, body: '') + @expected = nil + end + end + + it 'returns 3.2.1' do + stub_request_to_fixture( + url: uri.merge('wp-admin/js/wp-fullscreen.js').to_s, + fixture: fixture_dir + '3.2.1.js' + ) + + @expected = '3.2.1' + end + end + + describe '::find_from_readme' do + let(:url) { uri.merge('readme.html').to_s } + + after do + fixture = fixtures_dir + 'readme' + @fixture + stub_request_to_fixture(url: url, fixture: fixture) + + WpVersion.send(:find_from_readme, uri).should == @expected + end + + context 'when version not found' do + it 'returns nil' do + @fixture = '/empty_version.html' + @expected = nil + end + end + + context 'when invalid version' do + it 'returns nil' do + @fixture = '/invalid_version.html' + @expected = nil + end + end + + it 'returns 3.3.2' do + @fixture = '/3.3.2.html' + @expected = '3.3.2' + end + end + + describe '::find_from_links_opml' do + let(:url) { uri.merge('wp-links-opml.php') } + + after do + fixture = fixtures_dir + 'links_opml' + @fixture + stub_request_to_fixture(url: url, fixture: fixture) + + WpVersion.send(:find_from_links_opml, uri).should == @expected + end + + it 'returns 3.4.2' do + @fixture = '/3.4.2.xml' + @expected = '3.4.2' + end + + context 'when no generator' do + it 'returns nil' do + @fixture = '/no_generator.xml' + @expected = nil + end + end + end + + describe '::find' do + # Stub all WpVersion::find_from_* to return nil + def stub_all_to_nil + WpVersion.methods.grep(/^find_from_/).each do |method| + WpVersion.stub(method).and_return(nil) + end + end + + let(:wp_content_dir) { 'wp-content' } + let(:wp_plugins_dir) { wp_content_dir + '/plugins' } + let(:version_xml) {} + + after do + version = WpVersion.find(uri, wp_content_dir, wp_plugins_dir, version_xml) + version.should == @expected + if @expected + version.found_from.should == @found_from + end + end + + context 'when no version found' do + it 'returns nil' do + stub_all_to_nil() + @expected = nil + end + end + + WpVersion.methods.grep(/^find_from_/).each do |method| + number = "#{rand(5)}.#{rand(3)}" + found_from = method[/^find_from_(.*)/, 1].sub('_', ' ') + + context "when found from #{found_from}" do + it "returns the correct WpVersion" do + stub_all_to_nil() + + WpVersion.stub(method).and_return(number) + + @expected = WpVersion.new(uri, number: number) + @found_from = found_from + end + end + end + + end + +end diff --git a/spec/samples/wpscan/wp_version/advanced/3.2.1.js b/spec/samples/common/models/wp_version/findable/advanced_fingerprinting/3.2.1.js similarity index 100% rename from spec/samples/wpscan/wp_version/advanced/3.2.1.js rename to spec/samples/common/models/wp_version/findable/advanced_fingerprinting/3.2.1.js diff --git a/spec/samples/wpscan/wp_version/advanced/wp_versions.xml b/spec/samples/common/models/wp_version/findable/advanced_fingerprinting/wp_versions.xml similarity index 100% rename from spec/samples/wpscan/wp_version/advanced/wp_versions.xml rename to spec/samples/common/models/wp_version/findable/advanced_fingerprinting/wp_versions.xml diff --git a/spec/samples/wpscan/wp_version/atom-generator/3.3.2.htm b/spec/samples/common/models/wp_version/findable/atom_generator/3.3.2.html similarity index 100% rename from spec/samples/wpscan/wp_version/atom-generator/3.3.2.htm rename to spec/samples/common/models/wp_version/findable/atom_generator/3.3.2.html diff --git a/spec/samples/wpscan/wp_version/atom-generator/3.4-beta4.htm b/spec/samples/common/models/wp_version/findable/atom_generator/3.4-beta4.html similarity index 100% rename from spec/samples/wpscan/wp_version/atom-generator/3.4-beta4.htm rename to spec/samples/common/models/wp_version/findable/atom_generator/3.4-beta4.html diff --git a/spec/samples/wpscan/wp_version/atom-generator/invalid_version.htm b/spec/samples/common/models/wp_version/findable/atom_generator/invalid_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/atom-generator/invalid_version.htm rename to spec/samples/common/models/wp_version/findable/atom_generator/invalid_version.html diff --git a/spec/samples/wpscan/wp_version/atom-generator/no-atom-generator.htm b/spec/samples/common/models/wp_version/findable/atom_generator/no_generator.html similarity index 100% rename from spec/samples/wpscan/wp_version/atom-generator/no-atom-generator.htm rename to spec/samples/common/models/wp_version/findable/atom_generator/no_generator.html diff --git a/spec/samples/wpscan/wp_version/atom-generator/no-version.htm b/spec/samples/common/models/wp_version/findable/atom_generator/no_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/atom-generator/no-version.htm rename to spec/samples/common/models/wp_version/findable/atom_generator/no_version.html diff --git a/spec/samples/wpscan/wp_version/opml/wp-links-opml.xml b/spec/samples/common/models/wp_version/findable/links_opml/3.4.2.xml similarity index 100% rename from spec/samples/wpscan/wp_version/opml/wp-links-opml.xml rename to spec/samples/common/models/wp_version/findable/links_opml/3.4.2.xml diff --git a/spec/samples/wpscan/wp_version/opml/wp-links-opml-nogenerator.xml b/spec/samples/common/models/wp_version/findable/links_opml/no_generator.xml similarity index 100% rename from spec/samples/wpscan/wp_version/opml/wp-links-opml-nogenerator.xml rename to spec/samples/common/models/wp_version/findable/links_opml/no_generator.xml diff --git a/spec/samples/common/models/wp_version/findable/meta_generator/3.3.2.html b/spec/samples/common/models/wp_version/findable/meta_generator/3.3.2.html new file mode 100755 index 00000000..a082c08f --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/meta_generator/3.3.2.html @@ -0,0 +1,38 @@ + + + + + + + + + + +Wordpress 3.3.2 | Just another WordPress site + + + + + + + + + + + + + + + + diff --git a/spec/samples/common/models/wp_version/findable/meta_generator/3.4-beta4.html b/spec/samples/common/models/wp_version/findable/meta_generator/3.4-beta4.html new file mode 100755 index 00000000..6459ce8f --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/meta_generator/3.4-beta4.html @@ -0,0 +1,32 @@ + + + + + + + + + + +Wordpress 3.4 beta 4 | Just another WordPress site + + + + + + + + + + + + + diff --git a/spec/samples/wpscan/wp_version/meta-generator/3.5_minified.htm b/spec/samples/common/models/wp_version/findable/meta_generator/3.5_minified.html similarity index 100% rename from spec/samples/wpscan/wp_version/meta-generator/3.5_minified.htm rename to spec/samples/common/models/wp_version/findable/meta_generator/3.5_minified.html diff --git a/spec/samples/common/models/wp_version/findable/meta_generator/invalid_version.html b/spec/samples/common/models/wp_version/findable/meta_generator/invalid_version.html new file mode 100755 index 00000000..0ff860eb --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/meta_generator/invalid_version.html @@ -0,0 +1,38 @@ + + + + + + + + + + +Wordpress 3.3.2 | Just another WordPress site + + + + + + + + + + + + + + + + diff --git a/spec/samples/wpscan/wp_version/meta-generator/no-meta-generator.htm b/spec/samples/common/models/wp_version/findable/meta_generator/no_generator.html similarity index 100% rename from spec/samples/wpscan/wp_version/meta-generator/no-meta-generator.htm rename to spec/samples/common/models/wp_version/findable/meta_generator/no_generator.html diff --git a/spec/samples/common/models/wp_version/findable/meta_generator/no_version.html b/spec/samples/common/models/wp_version/findable/meta_generator/no_version.html new file mode 100644 index 00000000..7fef49fd --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/meta_generator/no_version.html @@ -0,0 +1,38 @@ + + + + + + + + + + +Wordpress 3.3.2 | Just another WordPress site + + + + + + + + + + + + + + + + diff --git a/spec/samples/wpscan/wp_version/rdf-generator/3.3.2.htm b/spec/samples/common/models/wp_version/findable/rdf_generator/3.3.2.html similarity index 100% rename from spec/samples/wpscan/wp_version/rdf-generator/3.3.2.htm rename to spec/samples/common/models/wp_version/findable/rdf_generator/3.3.2.html diff --git a/spec/samples/wpscan/wp_version/rdf-generator/3.4-beta4.htm b/spec/samples/common/models/wp_version/findable/rdf_generator/3.4-beta4.html similarity index 100% rename from spec/samples/wpscan/wp_version/rdf-generator/3.4-beta4.htm rename to spec/samples/common/models/wp_version/findable/rdf_generator/3.4-beta4.html diff --git a/spec/samples/wpscan/wp_version/rdf-generator/invalid_version.htm b/spec/samples/common/models/wp_version/findable/rdf_generator/invalid_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/rdf-generator/invalid_version.htm rename to spec/samples/common/models/wp_version/findable/rdf_generator/invalid_version.html diff --git a/spec/samples/wpscan/wp_version/rdf-generator/no-rdf-generator.htm b/spec/samples/common/models/wp_version/findable/rdf_generator/no_generator.html similarity index 100% rename from spec/samples/wpscan/wp_version/rdf-generator/no-rdf-generator.htm rename to spec/samples/common/models/wp_version/findable/rdf_generator/no_generator.html diff --git a/spec/samples/wpscan/wp_version/rdf-generator/no-version.htm b/spec/samples/common/models/wp_version/findable/rdf_generator/no_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/rdf-generator/no-version.htm rename to spec/samples/common/models/wp_version/findable/rdf_generator/no_version.html diff --git a/spec/samples/wpscan/wp_version/readme/readme-3.3.2.html b/spec/samples/common/models/wp_version/findable/readme/3.3.2.html similarity index 100% rename from spec/samples/wpscan/wp_version/readme/readme-3.3.2.html rename to spec/samples/common/models/wp_version/findable/readme/3.3.2.html diff --git a/spec/samples/wpscan/wp_version/readme/empty-version.html b/spec/samples/common/models/wp_version/findable/readme/empty_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/readme/empty-version.html rename to spec/samples/common/models/wp_version/findable/readme/empty_version.html diff --git a/spec/samples/wpscan/wp_version/readme/invalid_version.html b/spec/samples/common/models/wp_version/findable/readme/invalid_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/readme/invalid_version.html rename to spec/samples/common/models/wp_version/findable/readme/invalid_version.html diff --git a/spec/samples/wpscan/wp_version/rss-generator/3.3.2.htm b/spec/samples/common/models/wp_version/findable/rss_generator/3.3.2.html similarity index 100% rename from spec/samples/wpscan/wp_version/rss-generator/3.3.2.htm rename to spec/samples/common/models/wp_version/findable/rss_generator/3.3.2.html diff --git a/spec/samples/wpscan/wp_version/rss-generator/3.4-beta4.htm b/spec/samples/common/models/wp_version/findable/rss_generator/3.4-beta4.html similarity index 100% rename from spec/samples/wpscan/wp_version/rss-generator/3.4-beta4.htm rename to spec/samples/common/models/wp_version/findable/rss_generator/3.4-beta4.html diff --git a/spec/samples/wpscan/wp_version/rss-generator/invalid_version.htm b/spec/samples/common/models/wp_version/findable/rss_generator/invalid_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/rss-generator/invalid_version.htm rename to spec/samples/common/models/wp_version/findable/rss_generator/invalid_version.html diff --git a/spec/samples/wpscan/wp_version/rss-generator/no-rss-generator.htm b/spec/samples/common/models/wp_version/findable/rss_generator/no_generator.html similarity index 100% rename from spec/samples/wpscan/wp_version/rss-generator/no-rss-generator.htm rename to spec/samples/common/models/wp_version/findable/rss_generator/no_generator.html diff --git a/spec/samples/wpscan/wp_version/rss-generator/no-version.htm b/spec/samples/common/models/wp_version/findable/rss_generator/no_version.html similarity index 100% rename from spec/samples/wpscan/wp_version/rss-generator/no-version.htm rename to spec/samples/common/models/wp_version/findable/rss_generator/no_version.html diff --git a/spec/samples/common/models/wp_version/findable/sitemap_generator/3.3.2.html b/spec/samples/common/models/wp_version/findable/sitemap_generator/3.3.2.html new file mode 100644 index 00000000..93cbf91a --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/sitemap_generator/3.3.2.html @@ -0,0 +1,3 @@ + + + diff --git a/spec/samples/common/models/wp_version/findable/sitemap_generator/3.4-beta4.html b/spec/samples/common/models/wp_version/findable/sitemap_generator/3.4-beta4.html new file mode 100644 index 00000000..9d7c35b0 --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/sitemap_generator/3.4-beta4.html @@ -0,0 +1,3 @@ + + + diff --git a/spec/samples/common/models/wp_version/findable/sitemap_generator/invalid_version.html b/spec/samples/common/models/wp_version/findable/sitemap_generator/invalid_version.html new file mode 100644 index 00000000..e6327ecc --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/sitemap_generator/invalid_version.html @@ -0,0 +1,3 @@ + + + diff --git a/spec/samples/common/models/wp_version/findable/sitemap_generator/no_generator.html b/spec/samples/common/models/wp_version/findable/sitemap_generator/no_generator.html new file mode 100644 index 00000000..cf28468f --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/sitemap_generator/no_generator.html @@ -0,0 +1,3 @@ + + + diff --git a/spec/samples/common/models/wp_version/findable/sitemap_generator/no_version.html b/spec/samples/common/models/wp_version/findable/sitemap_generator/no_version.html new file mode 100644 index 00000000..b4a404f3 --- /dev/null +++ b/spec/samples/common/models/wp_version/findable/sitemap_generator/no_version.html @@ -0,0 +1,3 @@ + + + diff --git a/spec/samples/wp_versions/0.71-gold/layout2b.css b/spec/samples/wp_versions/0.71-gold/layout2b.css deleted file mode 100755 index 0b05e6d4..00000000 --- a/spec/samples/wp_versions/0.71-gold/layout2b.css +++ /dev/null @@ -1,171 +0,0 @@ -/* Default WordPress by Matthew Mullenweg http://photomatt.net - This is just a basic layout, with only the bare minimum defined. - Please tweak this and make it your own. :) -*/ - -a { - color: #069; -} - -a:visited { - color: #039; -} - -a:hover { - color: #39c; -} - -acronym, abbr { - border-bottom: 1px dashed #333; -} - -acronym, abbr, span.caps { - cursor: help; - font-size: 90%; - letter-spacing: .07em; -} - -blockquote { - border-left: 5px solid #ccc; - margin-left: 1.5em; - padding-left: 5px; -} - -body { - font-family: Georgia, "Times New Roman", Times, serif; - margin: 0; -} - -h2 { - border-bottom: 2px solid #ccc; - margin-bottom: 2px; -} - -p, li { - line-height: 130%; -} - -.b2calendarcell { - color: #000; -} - -.b2calendaremptycell { -} - -.b2calendarheadercell { - background: #808080; - color: #ccc; -} - -.b2calendarlinkpost { - color: #f00; - text-decoration: none; -} - -.b2calendarmonth { - color: #aaa; -} - -.b2calendarrow { - color: #0f0; -} - -.b2calendartable { - background: #fff; - border: 1px solid #000; -} - -.b2calendartoday { - color: #00f; -} - -.credit { - font-size: 11px; - text-align: center; -} - -.feedback { - text-align: right; - color: #ccc; -} - -.meta, .meta a { - color: #808080; - font-size: small; -} - -.storytitle a { - text-decoration: none; -} - -#content { - margin: 0 160px 0 20px; -} - -#header { - background-color: #808080; - margin: 0; - padding-left: 10px; -} - -#header a { - color: #fff; - text-decoration: none; -} - -#header a:hover { - color: #ccc; -} - -#menu { - background-color: #000; - border-left: 3px solid #666; - padding-bottom: 10px; - position: absolute; - right: 0; - top: 65px; - width: 150px; -} - -#menu form { - margin: 0 0 0 13px; -} - -#menu input { - background-color: #ccc; - border: 2px solid #666; -} - -#menu ul { - color: #ccc; - font-variant: small-caps; - font-weight: bold; - list-style-type: none; - margin: 0; - padding-left: 3px; -} - -#menu ul ul { - font-variant: normal; - font-weight: normal; - line-height: 100%; - list-style-type: none; - margin: 0; - padding: 0; - text-align: left; -} - -#menu ul ul li { - line-height: 115%; - padding-left: 12px; -} - -#menu ul ul li a { - color: #fff; - height: 13px; - text-decoration: none; -} - -#menu ul ul li a:hover { - border-bottom: 1px solid #ccc; -} \ No newline at end of file diff --git a/spec/samples/wp_versions/0.71-gold/readme.html b/spec/samples/wp_versions/0.71-gold/readme.html deleted file mode 100755 index bd819a54..00000000 --- a/spec/samples/wp_versions/0.71-gold/readme.html +++ /dev/null @@ -1,995 +0,0 @@ - - -WordPress > ReadMe - - - - - - - - - - -

WordPress
- 0.71

-

Weblog / News Publishing Tool

-

Requirements - Installation - - Template(s) - Query String - Usage - XML-RPC (Blogger API) - Post - Via Email - Notes

-

Requirements:

-
    -
  • PHP4 (version 4.0.6 or higher)
  • -
  • MySQL (version 3.23.23 or higher)
  • -
  • Perl (optional - only for the spellchecker)
  • -
  • ... and a link to http://wordpress.org - on your site.
  • -
-

The link will help promote WordPress - and is its only mean of promotion.

-

WordPress is built from b2, which comes from Michel V. We wouldn't be - here without him, so why don't you grab him something from his wishlist?

-

This document is currently beta stage, we'll be updating it extensively - as WordPress matures.

-

Installation:

-

New users: 5-minute install.

-
    -
  1. Unzip the package in an empty directory.
  2. -
  3. Open b2config.php in a text editor, and modify the variables as explained - in the comments. Comments are lines that start with # or /* or //
  4. -
  5. Upload everything. This release is designed to sit in your root folder, - IE the folder where your WordPress-powered page will reside.
  6. -
  7. CHMOD 666 the weblogs.com.changes.cache file.
  8. -
  9. Launch wp-install.php in your - browser. This should setup the MySQL database for your blog. If there - is an error, double check your b2config.php file, and try again. If - it fails again, please go to the support - forums and make a post with all the information about the failure - (error messages, etc), and your setup (the PHP and MySQL versions on - your server, and the browser you were using). Note the password - given to you.
  10. -
  11. Go to b2login.php and sign in with the - login "admin" and the password given to you by the install - script. Then click on the menu 'My Profile', and change the password. - Note: you need javascript enabled to launch the profile popup window.
  12. -
-

Some notes:

-
    -
  • Whenever you want to post something, just open a browser and go to - b2login.php to log in and post.
  • -
  • You can also use a bookmarklet and/or a sidebar (IE5+/NS6+) to post.
  • -
  • You can also post through the Blogger API, click - here for more info.
  • -
  • Your site's blog is on b2.php (simple template) and index.php (CSS - template), you can rename this file to index.php or any other name you - fancy (provided it bears the php extension or is interpreted as a php - file by your server).
  • -
  • You can also copy b2.php into a new file and modify that new file, - it will work too ;)
  • -
-

Users upgrading from b2 v0.6.1 to WordPress v0.7:

-
    -
  • All you really have to do is replace all the files with newer - versions and run b2-2-wp.php - and you should be ready to go.
  • -
  • If you're using an older version of b2, it's probably a good idea - to upgrade to at least .6.1 before making the leap to WordPress.
  • -
  • The templates are so much better, and there is so much more going - on than before it's probably worth it to start from scratch and work - back to your design.
  • -
  • You must update your b2config.php. There's all - sort of new stuff in there.
  • -
  • WordPress issues should be discussed in our support - forums.
  • -
  • Back up your database before you do anything. Yes, - you. Right now.
  • -
-

Template(s):

-

First notes:

-
    -
  • Enclosed is an example of a template, in the file b2.php. You can - rename this file to "index.php"or something else (recent b2 - versions have a default index.php, which is an elaborate CSS-based template).
  • -
  • You can have any number of template files, since all they do is extract - the posts from the database.
  • -
  • Pseudo-template for the comments is in b2comments.php. You needn't - rename this file, but you can edit it.
  • -
  • The only thing to remember is that it's not actually a template, but - a PHP file that you're manipulating. So when you see "don't delete - this line", you know you mustn't, unless you want to have a broken - page.
  • -
  • Required lines are: the first lines that call blog.header.php, the - lines with the "while" statement, and the ones with just "}" - (it ends the while loop).
  • -
  • Between the "while" line and the "}", is the template - for your posts.
  • -
-

Notes about parameters:

-
    -
  1. Some template tags can accept optional parameters between the parenthesis - ().
  2. -
  3. To add a parameter to a tag, enclose it between quotes and put it - between the ().
    - Example: <?php my_tag("my parameter"); ?>
  4. -
  5. You may have to put several parameters, for that you separate them - with commas.
    - Example: <?php my_tag("first param","second param"); ?>
  6. -
  7. The order of parameters is important. If a function accepts 2 parameters - and you only want to set the second one, you still have to provide the - first one, and so on for any number of parameters.
    - Example: <?php my_tag("","second param"); ?>
  8. -
  9. Some template tags, like the_date(), display something only if in - some conditions. They generally accept parameters to display something - before and after them only when they display something.
    - Example: <?php the_title("<h1>","</h1>"); ?> would - display <h1>title of the post</h1> only if the post has a title
    -
    -
  10. -
-

Template tags:

-
<?php the_date() ?> *
- the date of the post. example: 03.07.01 (default is dd.mm.yy).
- the date is displayed only on new days. for example if you got 10 posts - on the same day, the date for this day is displayed only once.
-
Parameters: -
    -
  • format string (default: "d.m.y")
  • -
  • string to display before the date (default is blank)
  • -
  • string to display after the date (default is blank)
  • -
-
-
- <?php the_time() ?>
- the time of the post. example: 18:37:00 (default is hh:mm:ss)
-
Parameters: -
    -
  • format string (default: "H:i:s")
  • -
-
-
- Note: you can change the way the date & time are - displayed in the Options page.
- once you understand the format strings for the date & time (explained - in the Options page), you can change the display right on the template: - for example, the_date("d.m.Y") - to have dates like 25.12.2001, the_time("B") - to have Swatch Internet Time.
- If you change the display of the date on the template, changing it from - the options page won't have any effect.br />
- Note about the_date(): if you want all your posts to - bear the date, you'll have to use the_time() instead, with a date format - string. for example, to have all your posts show like "25.12.2001 - @ 8:04:50 AM" you'll have the_time("d.m.Y @ g:i:s A"). - you can also repeat this template tag 2 times with 2 different formats: - the_time("d.m.Y") for the date, and then later the_time("g:i:s - A") for the time of the day.
-
- <?php the_weekday() ?>
- This displays the day of the week when the post was made. It works like - the_time(), in that it would appear at every post. Weekdays can be obtained - with a custom date format string in the_time() or the_date(), but for - non-english weekdays you have to edit b2config.php
- Note: this tag is OBSOLETE, the_time() and the_date() now use - weekdays/months from b2config.php
-
- <?php the_weekday_date() ?> *
- Like the_weekday(), but works like the_date(), in that it would appear - only on new days.
- Note: this tag is OBSOLETE, the_time() and the_date() now use - weekdays/months from b2config.php
-
Parameters: -
    -
  • string to display before the weekday_date (default is blank)
  • -
  • string to display after the weekday_date (default is blank)
  • -
-
-
-
- <?php the_ID() ?>
-
the ID (number) of the post.
-
- <?php the_title() ?>
-
The title of the post.
-
Parameters: -
    -
  • string to display before the title (default is blank)
  • -
  • string to display after the title (default is blank)
  • -
-
-
-
- <?php the_content() ?> *
-
The text of the post.
-
Parameters: -
    -
  • text to display for the link to the complete entry (default is - '(more...)')
  • -
  • 0 or 1, whether you want to show the teaser message or not, when - showing the complete text (default is 1)
  • -
  • a filename of another template, if you want the 'more' link to - link to a different template for the complete text of the extended - entry (default is the current template)
  • -
-
-
- For example <?php the_content("read more","0","blah.php") - ?> would display a link to blah.php, with the link text - read more, and won't display the teaser message.
-
- * - To enter an extended entry, just type <!--more--> in your - entry. The part before that comment is the teaser, the part after it is - the extended entry. To force the extended entry not to show the teaser - message, type <!--noteaser--> somewhere in your entry.
-
- * - To enter an entry with several pages, just type <!--nextpage--> - in your entry to start a new page.
-
-
- <?php next_post() ?> *
-
Displays a link to the next post(s). (Generally you might want - to use that tag only in single-post templates)
-
Parameters: -
    -
  • format string for the link (default is "%", where % is replaced - with the title of the next post)
  • -
  • text to display to announce the link (default is "next post: ")
  • -
  • "yes" or "no": display the title of the post, or no (default is - "yes")
  • -
  • "yes" or "no": display a link to the next post only if the next - post is in the same category (default is "no")
  • -
  • number: which next post ? if you make it '2', the 2nd next post - is linked instead of the 1st next one (default is "1", which means - first next post)
  • -
-
-
-
- <?php previous_post() ?> *
-
Displays a link to the previous post(s). (Generally you might - want to use that tag only in single-post templates)
-
Parameters: -
    -
  • format string for the link (default is "%", where % is replaced - with the title of the previous post)
  • -
  • text to display to announce the link (default is "previous post: - ")
  • -
  • "yes" or "no": display the title of the post, or no (default is - "yes")
  • -
  • "yes" or "no": display a link to the next post only if the previous - post is in the same category (default is "no")
  • -
  • number: which previous post ? if you make it '2', the 2nd previous - post is linked instead of the 1st previous post (default is "1", - which means first previous post)
  • -
-
-
-
- <?php next_posts() ?> *
-
Display the URL portion of a link to the next set of posts.
- Generally you would use this in a template to navigate to the next "set" - of posts when the "Show Options" settings for the site is set to "posts - paged". The displayed string can be used to construct a link. When the - site options are not set to 'posts paged", the next and previous functions - will display nothing.
-
Parameters: -
    -
  • Max page number to use. Default "0"; no limit
  • -
-
-
-
- <?php next_posts_link() ?> *
-
Displays a full link to the next "set" of posts only if show - options set to "posts paged" and only if there is another page or partial - page of data.
-
Parameters: -
    -
  • A user supplied string. Default "Next Page >>"
  • -
-
-
-
- <?php previous_posts() ?> *
-
Displays the URL portion of a link to the previous posts.
- Generally you would use this in a template to navigate to the previous - "set" of posts when the "Show Options" settings for the site is set to - "posts paged". The displayed string can then be used to construct a link. - When the site options are not set to 'posts paged", the next and previous - functions will display nothing.
-
Parameters: -
    -
  • No parameters.
  • -
-
-
-
- <?php previous_posts_link() ?> *
-
Displays a full link to the previous "set" of posts only if - show options set to "posts paged" and if there is a previous set, otherwise - nothing is displayed.
-
Parameters: -
    -
  • A user supplied string. Default "<< Previous Page"
  • -
-
-
-
- <?php posts_nav_link() ?> *
-
The function displays a complete navigation set of links including - a user definable "separator" with the ability to supply a the text string - to be used for the "previous" and "next" links.
- The default result will produce the following string:
-

<< Previous Page :: Next Page >>

-
Parameters: -
    -
  • A user supplied "separator" string. Default " :: "
  • -
  • A user supplied "previous" string. Default "<< Previous - Page"
  • -
  • A user supplied "next" string. Default "Next Page >>"
  • -
-
-
-
- <?php link_pages() ?> *
-
Displays links to the pages of the post if it's a multiple pages - post.
-
Parameters: -
    -
  • string to display before the tag (default is "<br />", a newline)
  • -
  • string to display after the tag (default is "<br />", a newline)
  • -
  • "next" or "number": display links like "next/previous page" or - links to each page with the number of the page "1 2 3 4 etc" (default - is "number")
  • -
  • string to display the "next page" link (default is "next page")
  • -
  • string to display the "previous page" link (default is "previous - page")
  • -
  • format string for the "number of page" link (default is "%", where - % is replaced by the number of the page)
  • -
  • file name, in case you want to load the posts with multiple pages - in a different template (default is the current template)
  • -
-
-
-
- <?php the_author() ?>
- The author of the post.
- Depending on the user's profile settings, it can display whether their - nickname, login name, first name, last name, both first& last name, - or last & first name. look below for more author-related template - tags.
-
- <?php the_category() ?>
-
the name of the category the post belongs to. you can as an admin - add categories, and rename them if needed. default category is 'General', - you can rename it too.
-
- <?php the_category_ID() ?>
-
The ID (number) of the category the post belongs to. This is - static data thatyou can use, for example to associate a category to an - image, or a css style.
-
- <?php trackback_rdf() ?> *
- This will include the RDF data that can be used by some weblog tools to - locate your posts' trackback URLs.
- You should put this tag after the <?php the_content() ?> tag in - your template, or just before the end of the loop.
-
- <?php dropdown_cats() ?>
-
this is a special tag, meant to be used in the template, but - outside of the b2 loop. it will display a list of <option name="x">category-name</option>, - where x is the number of the category and category-name - is the name of it.
-
Parameters: -
    -
  • 0 or 1, depending if you want to have an option to display all - categories (default is 1)
  • -
  • text to display for the option to show all categories (default - is "All")
  • -
-
-
- you can use it like this:
-
- <form action="<?php echo $PHP_SELF ?>" method="get">
- <?php dropdown_cats() ?>
- <input type="submit" name="submit" value="view" />
- </form>

-
- <?php list_cats() ?> *
-
this is a special tag, meant to be used in the template, but - outside of the b2 loop. it will display a list of the categories, with - links to them. like in b2archive.php, each category is on a line, the - only way you can change this is by editing b2.template.functions.php
-
Parameters: -
    -
  • 0 or 1, depending if you want to have an option to display all - categories (default is 1)
  • -
  • text to display for the option to show all categories (default - is 'All')
  • -
  • sort by: possible values are 'name' and 'ID' (default is 'ID')
  • -
  • sorting order: possible values are 'asc' for ascending or 'desc' - for descending (default is 'asc')
  • -
  • filename, in case you want to display the categories' posts in - another template (default is current template)
  • -
-
-
- <?php bloginfo() ?> *
- This tag is out of the b2 loop.
- It outputs info about your weblog.
-
Parameters: -
    -
  • string: can be 'name' to display the name of your weblog (you - set it in b2config.php), 'url', 'description', 'admin_email', 'rss_url' - to display the URL of your b2rss.xml file, 'pingback_url' to display - the URL of your xmlrpc.php file
    - (default string is 'name')
  • -
-
-
- <?php single_post_title() ?> *
- This tag is out of the b2 loop.
- It outputs the title of the post when you load the page with ?p= (see - 'Usage' section for explanation). When the weblog page is loaded without - ?p=, this tag doesn't display anything. Generally, you could use it like - this:
-    <title><?php bloginfo('name') ?><?php single_post_title() - ?></title>
-
Parameters: -
    -
  • prefix string that will appear before the post's title (default - is ' :: ')
  • -
-
-
- <?php single_cat_title() ?> *
- This tag is out of the b2 loop.
- It outputs the title of the category when you load the page with ?cat= - (see 'Usage' section for explanation). When the weblog page is loaded - without ?cat=, this tag doesn't display anything. Generally, you could - use it like this:
-    <title><?php bloginfo('name') ?><?php single_cat_title() - ?></title>
-
Parameters: -
    -
  • prefix string that will appear before the category's title (default - is ' :: ')
  • -
-
-
- <?php single_month_title() ?> *
- This tag is out of the b2 loop.
- It outputs the name of the month when you load the page with ?m= (see - 'Usage' section for explanation). When the weblog page is loaded without - ?m=, this tag doesn't display anything. Generally, you could use it like - this:
-    <title><?php bloginfo('name') ?><?php single_month_title() - ?></title>
-
Parameters: -
    -
  • prefix string that will appear before the month's name (default - is ' :: ')
  • -
-
-
- Note: The above three functions can be used together - to produce the Title of the page:
-    <title><?php bloginfo('name') ?><?php single_post_title(' - :: ') ?><?php single_cat_title(' :: ') ?><?php single_month_title(' - :: ') ?></title>
- Only one, if any, of these functions will produce output, thus the page - Title can be customize to the task being done.
-
-
- More about the author of the post ? Here goes:
-
- <?php the_author_email() ?> - the author's email.
- <?php the_author_url() ?> - the author's url.
- <?php the_author_email() ?> - the author's number - of posts.
- <?php the_author_icq() ?> - the author's ICQ number.
- <?php the_author_aim() ?> - the author's AIM handle.
- <?php the_author_yim() ?> - the author's Yahoo - Messenger handle.
- <?php the_author_msn() ?> - the author's MSN Messenger - handle.
- <?php the_author_posts() ?> - the author's post - count.
- <?php the_author_login() ?> - the author's login - name in b2. If you want some static data about the author, this is what - you're searching for. You can, for example, associate a picture with an - author, like this: <img src="pictures/<?php the_author_login() - ?>.jpg" border="0">
- <?php the_author_ID() ?> - the author's ID number - in b2. This number is automatically set when the user registers: to see - the ID of an user, go to the Team page. This is static data too, so you - can use it like the_author_login() in associating stuff with authors.
-
-
- Tags for permalinks
are:
-
- <?php permalink_anchor() ?> *
- this will display <a name="..."></a>, replacing - "..." with the ID or the title of the post in the database.
-
-
Parameters: -
    -
  • string for kind of anchor: either 'id' that displays '50', or - 'title' that displays 'title_of_post_50' (default is 'id')
  • -
-
-
- <?php permalink_link() ?> *
-
this will display the name of the file followed by #ID to link - to the post, in the month archive if archive-mode is "monthly".
- note: this tag does not display the link, for this you've got to type - <a href="<?php permalink_link() ?>">text of the - link</a>.
-
Parameters: -
    -
  • file name, in case you want to link the archive to a different - template (default is the current template)
  • -
  • string for kind of link: either 'id' that appends '#50' to the - link, or 'title' that appends '#title_of_post_50' (default is 'id')
  • -
-
-
-
- <?php permalink_single() ?> *
-
this will display the name of the file followed by #ID to link - to the entire post (the linked page will also show the extended text on - that post if it is an extended entry, and the comments).
- note: this tag does not display the link, for this you've got to type - <a href="<?php permalink_single() ?>">text of the - link</a>.
-
Parameters: -
    -
  • file name, in case you want to use a different template for single - posts (default is the current template)
  • -
-
-
-
-
- Tags for comments, trackback, and pingback are:
-
- <?php comments_popup_script() ?> *
- This will include the javascript that is required to open comments, trackback - and pingback in popup windows.
- You should put this tag before the </head> tag in your template.
-
Parameters: -
    -
  • width (default is 400)
  • -
  • height (default is 400)
  • -
  • file name, in case you want to use a different template for comments - (default is b2commentspopup.php)
  • -
  • file name, in case you want to use a different template for TrackBacks - (default is b2trackbackpopup.php)
  • -
  • file name, in case you want to use a different template for Pingbacks - (default is b2pingbackspopup.php)
  • -
-
-
-
- <?php comments_popup_link() ?>*
- This will display the link to open comments in a popup window, with the - number of comments.
- To edit the popup window's template, edit the file b2commentspopup.php - (it's the default one for comments popup).
-
- Note:
- The same tags exist for TrackBack and Pingback, respectively named 'trackback_popup_link()' - and 'pingback_popup_link()'. They take the same parameters.
-
-
Parameters: -
    -
  • string for comment-less posts (default is "no comments")
  • -
  • string for posts with one comment (default is "1 comment")
  • -
  • string for posts with 2 or more comments (default is "% comments")
    - Note here that the sign "%" is then replaced by the number - of comments.
  • -
  • string for CSS class, so you can have a styled link with class="" - (default is empty, no CSS class applied)
  • -
-
-
-
- <?php comments_link() ?>
-
This is a bit like permalink_link, it will display an URL to - the comments page, but again you'll have to create the link tag.
-
- Note:
- The same tags exist for TrackBack and Pingback, respectively named 'trackback_link()' - and 'pingback_link()'. They take the same parameters.
-
-
Parameters: -
    -
  • file name, in case you want to use a different template for comments - (default is the current template)
  • -
-
-
-
- <?php comments_number() ?>
- This displays the number of comments that have been posted on this post. - Example: "5 comments".
-
- Note:
- The same tags exist for TrackBack and Pingback, respectively named 'trackback_number()' - and 'pingback_number()'. They take the same parameters.
-
-
Parameters: -
    -
  • string for comment-less posts (default is "no comments")
  • -
  • string for posts with one comment (default is "1 comment")
  • -
  • string for posts with 2 or more comments (default is "% comments")
    - Note here that the sign "%" is then replaced by the number - of comments.
  • -
-
-
- Example: <?php comments_number("no comment","1 comment","% - comments") ?>
-
- This tag differs from v0.5's tag because in v0.5 and prior, it would only - display a number, not a text with it, so you could have terrible things - like "1 comments" (doh !)
-
- Necessary: <?php include("b2comments.php") ?>
- you'll put this line where you want the comments to be placed on your - page.
- typically, under the post itself. don't worry, the comments only appear - if the page is called in the comments mode. (like this: url?c=1)
-
- Necessary: <?php include("b2trackback.php") ?>
- you'll put this line where you want the TrackBacks to be placed on your - page.
- typically, under the post itself. don't worry, the TrackBacks only appear - if the page is called in the TrackBacks mode. (like this: url?tb=1)
-
- Necessary: <?php include("b2pingbacks.php") ?>
- you'll put this line where you want the Pingbacks to be placed on your - page.
- typically, under the post itself. don't worry, the Pingbacks only appear - if the page is called in the Pingbacks mode. (like this: url?pb=1)
-
-
- Tags that go in b2comments.php, b2trackback.php, b2pingbacks.php: - (these are easy too)
-
- <?php comment_author() ?>
- <?php comment_author_email() ?> - displays the - e-mail address, but not the link
- <?php comment_author_url() ?> - displays the url, - but not the link
-
- <?php comment_author_email_link() ?> *- - displays a link to the comment's author's e-mail
- <?php comment_author_url_link() ?> *- - displays a link to the comment's author's website
-
Parameters for comment_author_email_link() - and comment_author_url_link(): -
    -
  • string for the link (default: "email"/"url" depending on the tag)
  • -
  • string to display before the link (default is " - ")
  • -
  • string to display after the link (default is blank)
  • -
-
-
- <?php comment_author_IP() ?> - displays the IP - of the comment's author
- <?php comment_text() ?>
- <?php comment_date() ?>
- unlike the_date(), this tag appears - on every comment
- <?php comment_time() ?>

-
Parameters for comment_date() and - comment_time(): -
    -
  • format string (default is "d.m.y"/"H:i:s" depending on the tag)
  • -
-
-
- <?php trackback_url() ?> *
- This tag is out of the b2 TrackBacks loop.
- It will output the URL to TrackBack the post, that other people can copy - and use in b2's posting interface to trackback this post.
-
Parameters: -
    -
  • no parameter
  • -
-
-
-
- In b2comments.php b2trackback.php and b2pingbacks.php, like in the main - template file, please keep the first PHP lines, the "while" - lines, and the "}" lines.
- You can modify the form, but do not remove "<?php echo ... ?>" - and all the name="..." attributes.
-
-
- To include your archives:
-
- <?php include("b2archives.php") ?>
- this will include the links to your archives, one link per line.
- if your archive mode is "monthly", it will display the names - of the months and the years, like "july 2001".
- if your archive mode is "post by post", it will display the - titles of your posts, one title per line. if a post is untitled it will - display the ID (number) of this post.
-
-
- To include the calendar:
-
- <?php include("b2calendar.php") ?>
- this will include a table with the current month's calendar, each day - when you posted shows a link to this day's posts. You can customise this - table with CSS classes: -
.b2calendarmonth {}
-     the style that is used to display the month and year
- .b2calendartable {}
-     the style of the <table> tag (border etc...)
- .b2calendarrow {}
-     the style of the <tr> tag
- .b2calendarheadercell {}
-     the style of the <td> tag that shows the weekdays - on the top of the table
- .b2calendarcell {}
-     the style of the <td> tags that show the days
- .b2calendaremptycell {}
-     the style of the <td> tags that are empty
- .b2calendarlinkpost {}
-     the style of the link to the post
- .b2calendartoday {}
-     the style of the day if it is today
-
-

Query String Usage:

-

WordPress relies a lot on the query string, these variables passed with - the URL (note: to pass variables in the querystring, preceed the first - variable name with a '?' question mark and every other variables with - a '&' sign.)

-

Most of the time you won't have to do anything about it, but if you want - to know how it works, it's here:

-

How to use the query string:

-
index.php?m=200107 will display the month - of July 2001.
-
- index.php?m=20010701 will display all posts from July - 1st, 2001.
-
- index.php?w=20 will display the posts from the 20th week - of the year, where January 1st is in the first week (according to PHP).
-
- index.php?p=50 will display the post labeled #50 in the - database.
-
- index.php?s=blue+house will display the posts that match - the search request "blue house".
- here is the code for a simple search box:
-
- <form name="searchform" action="<?php echo - $PHP_SELF ?>" method="get">
- <input type="text" name="s" />
- <input type="submit" name="submit" value="search" - />
- </form>

-
- index.php?cat=1 will display all posts that belong to - category #1 (1 is the default). you can add/rename/delete categories from - b2's interface.
-
- index.php?author=1 will display all posts from the author - #1
-
- index.php?p=50&c=1 will display the comments and a form - to add a comment below the post.
- you should use this variable only with p=, example: index.php?p=50&c=1.
-
- index.php?p=50&tb=1 will display the TrackBacks to the - post #50.
- you should use this variable only with p=, example: index.php?p=50&tb=1.
-
- index.php?p=50&pb=1 will display the Pingbacks to the - post #50.
- you should use this variable only with p=, example: index.php?p=50&pb=1.
-
- index.php?p=50&more=1 will display the extended entries' - text. this, too, should be used only with p=, for individual - entries.
-
- index.php?p=50&page=1 will display the first page of - post #50. this, again, should be used only with p=, for - individual entries.
-
- You can also mix these variables, example: index.php?m=200107&s=hotdog - will display the posts that match the search request "hotdog", - but only in July 2001.
-

 

-

XML-RPC Interface:

-

WordPress now has a XMLRPC interface. The only API available right now - is the Blogger API (complete specs here). - There are talks about a new API that would cover a lot of weblog/CMS systems - in the future: when it's ready, WordPress will support it.

-

The Blogger API has been - completely emulated on WordPress, with some little differences:

-
    -
  • using blogger.getRecentPosts with the number 'zero' returns - all posts in the blog
  • -
  • blogger.getTemplate fetches your file $blogfilename (as specified - in the config), while blogger.setTemplate overwrites it with - the edited data
  • -
  • blogger.getUsersBlogs is a dummy function that returns '1' - and $blogname, since b2 supports only one blog as of now
  • -
-

If you use blogger.newPost, your post is submitted without title and - in category #1.

-

However, you can type <title>my title</title> and/or <category>2<category> - in the body of your post to make its title be 'my title' and its category - be #2 (refer to your categories section to find out the ID numbers of - the categories). b2 would then delete that extra info from the body of - your post once it is posted.

-

You can now post to your b2 blog with tools like BlogBuddy, - Bloggar, WapBlogger - (post from your Wap cellphone!), Radio - Userland (which means you can use Radio's email-to-blog feature), - and other tools that support the Blogger API ! :)

-

Your XMLRPC server/path are as described here: if you login to b2 on - http://mydomain.com/me/b2login.php, then you have:

-
    -
  • server: http://example.com/me
  • -
  • path: /me/xmlrpc.php
  • -
  • complete URL (just in case): http://example.com/me/xmlrpc.php
  • -
-

There's also a b2-specific method: b2.getCategories. Request it with - 3 strings: blog_ID (use '1'), username, password. The response is an array - of structs with strings categoryID and categoryName.
-
-

-

 

-

Post via Email:

-

You can post news from an email client!
- But first you'll have to edit b2config.php, filling the appropriate values - for your POP3 email account (this interface doesn't support IMAP yet, - only POP3, sorry).

-

Once you have edited the config options, you can make your webserver - execute b2mail.php every set amount of time (depending on your host's - performance, this script can be resource intensive, so don't make it run - every minute or you'll be kicked).

-

You can do it with Cron-jobs, or if your host doesn't support it you - can look into the various website-monitoring services, and make them check - your b2mail.php URL.

-

Preliminary advice:

-

It is strongly advised to send your email as text-only (Outlook and - Outlook Express default to 'html', which may cause problems), but HTML - email could work (the script would strip all your html tags though...).

-

It is also advised not to use your public email address, but create a - new one especially for this script. If you use your public email address - and the script goes crazy posting every email on your blog and deleting - all your emails, I can't take responsibility for this.

-

Make sure you delete any email sent to your blog in your 'Sent' folder - too, just in case (you don't want someone to find your login and password - in the 'Sent' folder).

-

The script will delete the emails that were used to post stuff - on your weblog if it successfully posted your stuff. If it didn't manage - to post, the email is not deleted.

-

How to post:

-

Now to post something, here's how your email should look like:

-
To: address@domain.com (you - set it in the config file)
- Subject: blog:the post's title (you can - change 'blog:' in the config file)
- Body:
- login:password (example: Jack:Starwars)
- The content of the post, blah blah blah.
- More blah blah. ___
-

Subject must start with 'blog:', or any string you set in the config - file (so that the script doesn't check EVERY email in your mailbox).

-

Body's first line must always be login:password, else the script will - just skip the email.
- If you don't use '___' (or any body terminator that you set in the config - file), the script will post the whole body, which is not what you want - if you send email with Yahoo or Hotmail (you don't want their ads on your - blog, do you ?).

-

Special cases for mobile phone email:

-

Some mobile phone service providers may allow you to send email with - your mobile phone or PDA, but on such devices you can't always include - line breaks. In such case, you have to set $use_phoneemail = 1 - in b2config.php, and then here's how you write the email:

-
To: address@domain.com
- Subject: blog:the post's title :::
- Body:
- login:password ::: The content of the post, blah blah blah.___ -
-

You will have to append ':::' (or whatever string you set in the config - file) after the subject, and after the login:password.
-
- Some mobile phone service providers may not allow you to set a subject, - and they'll make the subject be the first characters of the body, in which - case you would send an email like this:

-
To: address@domain.com
- Body:
- blog:the post's title ::: login:password ::: The content - of the post, blah blah blah.___
-

 

-

Notes:

-

On multi-user:

-

New users can register with b2register.php. Then you (as - an admin) click the "+" next to their name on the Team page - in admin to upgrade their level to 1 or more, so they can post. If you - don't want an user to post anymore, just click "-" until their - level is 0.

-

Note: you can now disable users registration altogether from the config - file.

-

Levels:

-
    -
  • 0 - new user: can't post.
  • -
  • 1 - user: can post & edit/delete their own posts.
  • -
  • 3 & more - admin: can post, edit/delete other people's posts, - and change the options.
  • -
  • Any user whose level is higher than 1, can edit/delete the posts and - change the level of users whose level is inferior. Example: a level - 2 user is not an admin, but can edit the posts of level 1 users, and - up the level of a new user from 0 to 1.
  • -
-

Usually, you'll want to have a team of only level 1 users except you. - ;)

-

Note: you can modify a variable in b2config.php, to - enable new users to post once they've registered.

-

If you don't want users to register on your blog at all, just delete - b2register.php once you've registered your user account.

-


- Final notes:

-
    -
  • WordPress is functional, but a lot of coding and code clean-up remain - to be done.
  • -
  • If you've got suggestions, ideas, or comments, or if you found a bug, - why not joining us in the Support - Forums?
  • -
  • If you can code in PHP, you'll see the structure of WordPress is flexible - enough to allow for more functions and sections to be added.
  • -
-


- Copyright notes:

-
    -
  • Wherever third party code has been used, credit has been given in - the code's comments.
  • -
  • WordPress is released under the GPL - (see license.txt).
  • -
-

 

- - \ No newline at end of file diff --git a/spec/samples/wp_versions/1.2-delta/readme.html b/spec/samples/wp_versions/1.2-delta/readme.html deleted file mode 100755 index ed6522fd..00000000 --- a/spec/samples/wp_versions/1.2-delta/readme.html +++ /dev/null @@ -1,248 +0,0 @@ - - - -WordPress—ReadMe - - - - -

WordPress
-Version 1.0.1

-

Weblog / News Publishing Tool

-

Requirements - Installation - Template(s) - Query String Usage - XML-RPC (Blogging APIs) - Post Via Email - Notes

-

Requirements:

- -

The link will help promote WordPress and is its only mean of promotion.

-

WordPress is the official continuation of b2, which comes from Michel V. The work has been continued by the WordPress developers. If you would like to support WordPress, please consider donating.

-

This document is currently beta stage, we'll be updating it extensively as WordPress matures. There is also online documentation under development, as well as a wiki.

-

Installation:

-

New users: 5-minute install.

-
    -
  1. Unzip the package in an empty directory.
  2. -
  3. Upload everything. This release is designed to sit in your root folder; i.e, the folder where your WordPress-powered page will reside.
  4. -
  5. (Optional) If you're going to use it, the weblogs.com cache file needs to be writable by the web server. CHMOD 666 the wp-content/link-update-cache.xml file.
  6. -
  7. -

    Point your browser to wp-admin/install-config.php. This will create a configuration file for your installation. You'll need to know your database name, username, password, and host name.

    -

    Alternately, you may open wp-config-sample.php in a text editor and insert your database name, username, password, and host name as indicated in the comments. (Comments are lines that start with /* or //.) Save this file as wp-config.php, and upload it.

    -
  8. -
  9. Launch /wp-admin/install.php in your browser. This should setup the MySQL database for your blog. Note the password given to you. If there is an error, double check your wp-config.php file, and try again. If it fails again, please go to the support forums and make a post with all the information about the failure (error messages, etc), and your setup (the PHP and MySQL versions on your server, and the browser you were using).
  10. -
  11. The install script should then send you to the login page. Sign in with the username "admin" and the password generated during the installation. Then click on the item 'My Profile', and change the password. The login page may also be accessed by going to wp-login.php.
  12. -
-

Some notes:

- - -

Preface for all upgrades:

- - -

Upgrading from any previous WordPress to v1.0.1:

- -

Note on upgrading to v1.0.1:

-