Skip to content

Commit

Permalink
OpenSearch now use forum_link($forum_url['opensearch']).
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkalinux committed Feb 19, 2012
1 parent b0454e8 commit cf1e322
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion header.php
Expand Up @@ -108,7 +108,7 @@
if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
{
$forum_head['search'] = '<link rel="search" type="text/html" href="'.forum_link($forum_url['search']).'" title="'.$lang_common['Search'].'" />';
$forum_head['opensearch'] = '<link rel="search" type="application/opensearchdescription+xml" href="'.forum_link('misc.php?action=opensearch').'" title="'.forum_htmlencode($forum_config['o_board_title']).'" />';
$forum_head['opensearch'] = '<link rel="search" type="application/opensearchdescription+xml" href="'.forum_link($forum_url['opensearch']).'" title="'.forum_htmlencode($forum_config['o_board_title']).'" />';
}

$forum_head['author'] = '<link rel="author" type="text/html" href="'.forum_link($forum_url['users']).'" title="'.$lang_common['User list'].'" />';
Expand Down
1 change: 1 addition & 0 deletions include/url/Default/forum_urls.php
Expand Up @@ -38,6 +38,7 @@
'mark_forum_read' => 'misc.php?action=markforumread&amp;fid=$1&amp;csrf_token=$2',
'new_topic' => 'post.php?fid=$1',
'new_reply' => 'post.php?tid=$1',
'opensearch' => 'misc.php?action=opensearch',
'post' => 'viewtopic.php?pid=$1#p$1',
'profile_about' => 'profile.php?section=about&amp;id=$1',
'profile_identity' => 'profile.php?section=identity&amp;id=$1',
Expand Down
1 change: 1 addition & 0 deletions include/url/File_based/forum_urls.php
Expand Up @@ -40,6 +40,7 @@
'mark_forum_read' => 'mark-forum$1-read-$2.html',
'new_topic' => 'new-topic$1.html',
'new_reply' => 'new-reply$1.html',
'opensearch' => 'misc.php?action=opensearch',
'post' => 'post$1.html#p$1',
'profile_about' => 'user$1-about.html',
'profile_identity' => 'user$1-identity.html',
Expand Down
1 change: 1 addition & 0 deletions include/url/File_based_(fancy)/forum_urls.php
Expand Up @@ -41,6 +41,7 @@
'mark_forum_read' => 'mark-forum$1-read-$2.html',
'new_topic' => 'new-topic$1.html',
'new_reply' => 'new-reply$1.html',
'opensearch' => 'misc.php?action=opensearch',
'post' => 'post$1.html#p$1',
'profile_about' => 'user$1-about.html',
'profile_identity' => 'user$1-identity.html',
Expand Down
1 change: 1 addition & 0 deletions include/url/Folder_based/forum_urls.php
Expand Up @@ -38,6 +38,7 @@
'mark_forum_read' => 'mark/forum/$1/read/$2/',
'new_topic' => 'new/topic/$1/',
'new_reply' => 'new/reply/$1/',
'opensearch' => 'misc.php?action=opensearch',
'post' => 'post/$1/#p$1',
'profile_about' => 'user/$1/about/',
'profile_identity' => 'user/$1/identity/',
Expand Down
1 change: 1 addition & 0 deletions include/url/Folder_based_(fancy)/forum_urls.php
Expand Up @@ -39,6 +39,7 @@
'mark_forum_read' => 'mark/forum/$1/read/$2/',
'new_topic' => 'new/topic/$1/',
'new_reply' => 'new/reply/$1/',
'opensearch' => 'misc.php?action=opensearch',
'post' => 'post/$1/#p$1',
'profile_about' => 'user/$1/about/',
'profile_identity' => 'user/$1/identity/',
Expand Down
5 changes: 2 additions & 3 deletions misc.php
Expand Up @@ -152,7 +152,6 @@
redirect(forum_link($forum_url['forum'], array($fid, sef_friendly($forum_name))), $lang_misc['Mark forum read redirect']);
}


// OpenSearch plugin?
else if ($action == 'opensearch')
{
Expand All @@ -170,15 +169,15 @@
echo "\t".'<OutputEncoding>utf-8</OutputEncoding>'."\n";
echo "\t".'<Image width="16" height="16" type="image/x-icon">'.$base_url.'/favicon.ico</Image>'."\n";
echo "\t".'<Url type="text/html" method="get" template="'.$base_url.'/search.php?action=search&amp;source=opensearch&amp;keywords={searchTerms}"/>'."\n";
echo "\t".'<Url type="application/opensearchdescription+xml" rel="self" template="'.$base_url.'/misc.php?action=opensearch"/>'."\n";
echo "\t".'<Url type="application/opensearchdescription+xml" rel="self" template="'.forum_link($forum_url['opensearch']).'"/>'."\n";
echo "\t".'<Contact>'.forum_htmlencode($forum_config['o_admin_email']).'</Contact>'."\n";

if ($forum_config['o_show_version'] == '1')
echo "\t".'<Attribution>PunBB '.$forum_config['o_cur_version'].'</Attribution>'."\n";
else
echo "\t".'<Attribution>PunBB</Attribution>'."\n";

echo "\t".'<moz:SearchForm>'.$base_url.'/search.php</moz:SearchForm>'."\n";
echo "\t".'<moz:SearchForm>'.forum_link($forum_url['search']).'</moz:SearchForm>'."\n";
echo '</OpenSearchDescription>'."\n";

exit;
Expand Down

0 comments on commit cf1e322

Please sign in to comment.