News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Google BBC Tag

Started by JayBachatero, September 21, 2005, 12:13:10 PM

Previous topic - Next topic

JayBachatero

Link to Mod

Ver. 2.5.2
KGIII is now maintaining the mod. (Don't ask what happened to 2.5.1)
Updated to work with SMF 1.1.2
May work with SMF 1.1.1 actually - untested.
Again, if you can come up with a better image it would be appreciated.

Ver. 2.5
Added the BBC button for it.  The image looks crappy so if you can get me a better image I'll appreciate it :P

Ver. 2.0
I added the enable/disable option in the admin page.  By default it's enabled.  To disable it go to
     Admin > Posts and Topics > Uncheck Enable Google Search Tags
Also when the tag is disabled it will just show Google Search: query in red

Use the tags like this same as 1.0
   Put the search text in between the  [google][/google] tags
      [google]SMF rocks![/google]
   or if you want to get creative
      [google=SMF rocks!]Update your phpBB[/google]

Ver. 1.0
This MOD just adds the BBC Google Seach Tag.  You can search two ways.

   Put the search text in between the  [google][/google] tags
      [google]SMF rocks![/google]
   or if you want to get creative
      [google=SMF rocks!]Update your phpBB[/google]

For now the default text that is added when the tag is inserted is Google Search: SMF Rocks!
In the future I might just add the ability to insert custom text for search.

Also thanks to [Unknown] for looking over the code and to all the developers here for making this great software.  And to the original mod creator for phpBB
ENABLED


DISABLED


SETTINGS
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

DemonicInfluence


JayBachatero

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Elmacik

thats really nice

what about getting the search results into that thread :D (this would be greater :D :D ;D )

thanks
Home of Elmacik


1MileCrash

The only thing php can't do is tell you how much milk is left in the fridge.



JayBachatero

Quote from: Tippmaster on September 21, 2005, 08:33:51 PM
wasnt this made before?

Yea it was made for 1.0.5 but all it did was add the  [google] tags.

I did this one with the settings and the other google tag.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Ivan Minic

Rulez  ;D
And it is easy to modify...

JayBachatero

Quote from: Ivan Minic on September 22, 2005, 02:14:21 AM
Rulez  ;D
And it is easy to modify...

Thanks for the comment.  I should have an updated version that would workk on Beta 3, 4 and RC1.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

JayBachatero

Sorry for the delay in update.  I updated the mod and now works for b3 b4 and rc1.  any problems let me know.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

JayBachatero

Updated for 1.1 RC2.  The latest package there only contains the files for RC2 and nothing else.

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Greybrow

I'm getting strange error in Post.template.php

After modification I'm getting
'google' => array('code' => 'google', 'before' => '[google=smf rules]', 'after' => '[/google]', 'description' => $txt['google']),
$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),

instead of
$context['bbc_tags'][] = array(
'flash' => array('code' => 'flash', 'before' => '[flash=200,200]', 'after' => '[/flash]', 'description' => $txt[433]),
'google' => array('code' => 'google', 'before' => '[google=smf rules]', 'after' => '[/google]', 'description' => $txt['google']),


Any help?

TheMaTrIx

Already talked to Jay about it. Seems before and after statements in the mod system act the exact oposite way of what one would think  :P

Hes aware and updating it.

Also check the code that was added to the admin template, it got swapped the very same way.

JayBachatero

To make sure that when you uninstall it it works like it should I suggest that you uninstall it and install the updated one.  I already fixed this. 

The issue with the bbc I had fixed it but it seemed that I forgot to update the file in the zip and just updated the regular file that I was working on.

Thanks TheMatrix for informing me about this.  I greatly appreciate it.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

H

This is one of the first mods I have seen which can actually be really useful.

Maybe it could be extended and also have a forum search tag?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

JayBachatero

It can actually be done.  Try this out in subs.php


array(
'tag' => 'search',
'type' => 'unparsed_content',
'content' => 'Search the forum: <a href="' ,$scripturl, '?action=search;search=$1" target="_blank">$1</a>',
'validate' => create_function('&$tag, &$data, $disabled', '$data = strtr($data, array(\'<br />\' => \'\'));'),
                'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_content' => '<span style="color: red;">Search the forum: $1</span>',
),


Code (find) Select

if (empty($modSettings['enableEmbeddedFlash']))
$disabled['flash'] = true;


Code (add) Select

$disabled['search'] = false;


I didn't test this but it should work.  I left the target="_blank" so it opens in a new window but it's up to you to chage this.  I still prefer [Unknown]'s mod [[]]  ;)

Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Greybrow

Installed new version, and it works :)

Suggestions:
'content' => 'Google Search: <a href="http://www.google.com/search?q=$1" target="_blank">$1</a>',
I think this fraze 'Google Search' should be a translation string -> $txt['google']

I also think, that also url to google, should be transtlation string, to point to translated google site eg. http://www.google.pl/search?hl=pl&q=$1

JayBachatero

Yea I was thinking about this too.  I may add a text box on the admin panel so that you can enter the text your preffer :)  I'm not sure about the url to google.  I'll take a look into this.  Thanks for the input :)

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

daragor

great mod, thanks. but u can optimize the bcc button for default theme? he is ugly

bye mate!
Webscom: Wordpress + SMF
Software Libre, Noticias y Entretenimiento.-

JayBachatero

I need to gind a better looking image.  if you are able to find a good looking one please let me know :P
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Advertisement: