Is there a google search plugin?
Is there a google search plugin?
not a good way to describe it but pretty simple to explain it.
is there a plugin when i say something refering to somethg in my post that i can creat a link to search google?
EXAMPLE
this [google]plugin[/google] is what im talking about
possible? or available already?
is there a plugin when i say something refering to somethg in my post that i can creat a link to search google?
EXAMPLE
this [google]plugin[/google] is what im talking about
possible? or available already?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Is there a google search plugin?
A plugin similar to thise is the "Content Rewrite" plugin. You could use [googlestart]bla[googleend] and then rewrite [googlestart] to the start " html code and [googleend] to tags.
Of course this is a bit hacky and I would suggest to create a special plugin for this. Or enhance the "bbcode" markup for this. In either case the BBCode plugin is a good starting point. Have a go!
Regards,
Garvin
Code: Select all
<a href="google.com/search?word=
Code: Select all
">
Of course this is a bit hacky and I would suggest to create a special plugin for this. Or enhance the "bbcode" markup for this. In either case the BBCode plugin is a good starting point. Have a go!
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: Is there a google search plugin?
garvin,garvinhicking wrote:A plugin similar to thise is the "Content Rewrite" plugin. You could use [googlestart]bla[googleend] and then rewrite [googlestart] to the start" html code and [googleend] toCode: Select all
<a href="google.com/search?word=
tags.Code: Select all
">
Of course this is a bit hacky and I would suggest to create a special plugin for this. Or enhance the "bbcode" markup for this. In either case the BBCode plugin is a good starting point. Have a go!
Regards,
Garvin
thanks for the reply and solution, but im not too educated with treating this plugin to do what you said ..
can i bother your for a more clearer setup of this plugin?
Thanks again ..
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Is there a google search plugin?
I hjave just patched and committed the BBCode plugin.
You can do so easily by opening your plugins/serendipity_event_bbcode/serendipity_event_bbcode.php file.
Search for this block:
and add the google block so that it looks like:
Have fun!
You can do so easily by opening your plugins/serendipity_event_bbcode/serendipity_event_bbcode.php file.
Search for this block:
Code: Select all
// [url]
'/(?<!\\\\)\[url(?::\w+)?\]www\.(.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"http://www.\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?=(.*?)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\" class=\"bb-url\">\\2</a>",
Code: Select all
// [url]
'/(?<!\\\\)\[(google|search)\](.*?)\[\/(google|search)\]/si' => "<a href=\"http://www.google.de/search?q=\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?\]www\.(.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"http://www.\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?=(.*?)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\" class=\"bb-url\">\\2</a>",
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Oh, my bad. I'm really sorry!
You type your entries like this:
Have fun!
Regards,
Garvin
You type your entries like this:
Code: Select all
Here's a link to know more about it: [google]Serendipity[/google]
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi learonard.
I guess this is not my lucky sundy today
In the code you pasted, please replace "\\1" with "\\2" and then all should be well
Regards,
Garvin
I guess this is not my lucky sundy today
In the code you pasted, please replace "\\1" with "\\2" and then all should be well
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hm, I suppose you then replaced the wrong ones?! Here's how it's supposed to look like:
What's your URL so I can look at it?
Code: Select all
'/(?<!\\\\)\[(google|search)\](.*?)\[\/(google|search)\]/si' => "<a href=\"http://www.google.de/search?q=\\2\" target=\"_blank\" class=\"bb-url\">\\2</a>",
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
I guess it was my error .. or i misunderstood ..garvinhicking wrote:Hm, I suppose you then replaced the wrong ones?! Here's how it's supposed to look like:
What's your URL so I can look at it?Code: Select all
'/(?<!\\\\)\[(google|search)\](.*?)\[\/(google|search)\]/si' => "<a href="http://www.google.de/search?q=\\2" target="_blank" class="bb-url">\\2</a>",
i changed all the lines to \\2 .. after reapplying the original code you gave me and then changing the line you defined above, all is well now.. thanks garvin ..
the link to look at it all is ..
http://www.leonarddbernstein.com/index. ... l#extended
see if you can spot where its at
thanks much again garvin ..
Lenny
BTW ..
the final code..
the final code..
Code: Select all
// [url]
'/(?<!\\\\)\[(google|search)\](.*?)\[\/(google|search)\]/si' => "<a href=\"http://www.google.de/search?q=\\2\" target=\"_blank\" class=\"bb-url\">\\2</a>",
'/(?<!\\\\)\[url(?::\w+)?\]www\.(.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"http://www.\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\" class=\"bb-url\">\\1</a>",
'/(?<!\\\\)\[url(?::\w+)?=(.*?)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\" class=\"bb-url\">\\2</a>",