[2.0.17] Wikipedia Reference BBCode

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
10
77%
Very Good
2
15%
Good
0
No votes
Fair
1
8%
Poor
0
No votes
 
Total votes: 13

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27733
Joined: Sat Aug 16, 2003 7:36 am

[2.0.17] Wikipedia Reference BBCode

Post by Extensions Robot » Mon Aug 01, 2005 8:53 pm

MOD Name: Wikipedia Reference BBCode
Author: paul.tgk
MOD Description: Allows you to make keywords in your post
link to those entries at WikiPedia.
(keyword) en being english,
Supports the following Wikipedia languages:
English (en), Deutsch (de), Francias (fr), Nederlands (nl),
Portugues (pt), Italiano (it), Espanol (es), Polski (pl)
Svenski (sv).


MOD Version: 1.0.43

Download File: wikiPedia_bbcode_1_0_43.mod
mods overview page: View
File Size: 10743 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:28 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Fri Aug 05, 2005 4:05 am

MOD Validated/Released

Notes:
Using this MOD allows an additional Wiki bbcode to be used. Word enclosed with the bbcode is transformed into a link to Wikipedia.

slant
Registered User
Posts: 17
Joined: Mon May 30, 2005 8:00 pm

Post by slant » Fri Aug 19, 2005 2:19 am

This is something I've been waiting for for a long time!! I got this as soon as I saw that it was available. I immediately started the implementation process only to get stuck on the first line. I could not find the following line at all in 'includes/bbcode.php':

Code: Select all

$EMBB_widths = array(''
I am using phpBB 2.0.15. Any thoughts? I'm willing to try anything! ;p I'm excited to get this working. Thanks for putting forth the effort to make this.

slant
Registered User
Posts: 17
Joined: Mon May 30, 2005 8:00 pm

Post by slant » Fri Aug 19, 2005 2:45 am

<talks_to_self>Does the phrase "You must have Multiple BBCode MOD v1.4.0 or newer installed for this to work," mean anything to you?</talks_to_self>

Sheesh... I'm headed there now. Sorry to junk this thread up. It's called reading. I suppose that I've installed so many mods that didn't need any supplimental mods that required just line edits that I didn't even think to look.

paul7v7
Registered User
Posts: 44
Joined: Mon Nov 15, 2004 9:40 am

Post by paul7v7 » Fri Aug 19, 2005 10:59 am

i too am stuck on the first line...

Mistainu
Registered User
Posts: 44
Joined: Thu Jul 14, 2005 2:57 pm
Location: Nusantara
Contact:

COMBO REQUEST?

Post by Mistainu » Mon Aug 22, 2005 1:49 pm

yup i'm fussy so...here's an idea. i searched up "wiki" under MODs, came up with only FOKI at first. it's still in BETA but i think it's a good idea. could someone come up with a integrated or bundled FOKI/Wikipedia-Ref MOD? i think it's a cool idea, like a in-house wiki for editability ridding of redundant additions; plus references for terms to a established wiki (Wikipedia in this case), which rids of redundant questions of what is and all that. i think by enforcing these 2, a more fertile forums can be grown (forgive my farming terms =D), thus ridding us of pesky noobs (ops newbies...)!
how's that? someone reply with a YES? :?

slant
Registered User
Posts: 17
Joined: Mon May 30, 2005 8:00 pm

Re: COMBO REQUEST?

Post by slant » Wed Aug 24, 2005 4:31 am

Mistainu wrote: someone reply with a YES? :?


YES?

;p

I think that could be very interesting! I'm just hoping we can get this working first. One step at a time, right?

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Fri Aug 26, 2005 4:43 am

Excellent Job!!! This MOD installed with only a few minor adjustments using EasyMod into my heavily modded board, which has 12 templates. This MOD works exactly as advertised. Thanks for your contribution paul.tgk..

:lol:

User avatar
Serj21
Registered User
Posts: 137
Joined: Thu Apr 15, 2004 6:23 pm
Contact:

Post by Serj21 » Wed Jan 04, 2006 2:06 pm

I like this mod, it gave me idea to adapt it to allow linking to my very own wiki but does anyone have any ideas how to make the links bold like standard links using the URL bbcode?

User avatar
Serj21
Registered User
Posts: 137
Joined: Thu Apr 15, 2004 6:23 pm
Contact:

Post by Serj21 » Wed Jan 04, 2006 2:27 pm

ah wasn't that hard. I just changed:

in bbcode.tpl

Code: Select all

#
#-----[ OPEN ]---------------------------------------
#
open templates/subSilver/bbcode.tpl

#
#-----[ FIND ]---------------------------------------
#
<!-- BEGIN wiki --><a href="http://en.wikipedia.org/wiki/{QUERY}" target="_blank">{STRING}</a><!-- END wiki -->

#
#-----[ REPLACE WITH ]-------------------------------
#
<!-- BEGIN wiki --><a href="http://en.wikipedia.org/wiki/{QUERY}" target="_blank" class="postlink">{STRING}</a><!-- END wiki -->

Do the same for all the other links you might have in the file etc.

This worked fine for me so thought I would share it with others incase they want it

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Tue Jan 17, 2006 7:39 am

Does anyone else have any problems with this mod? I've installed it and checked it several times, yet the [wiki] tags fail to make a clickable link. Anyone have any suggestions?

I decided to make my own Wikipedia BBcode just as a test. This code works, although the search term sometimes needs to be in the correct upper/lowercase, such as "Beatles". So if this code works, why not the original mod? I am baffled.

Just for reference, my simple Wiki BBcode consisted of this (not meant to be a fully documented mod):

Code: Select all

in bbcode.php add...

$bbcode_tpl['wiki'] = str_replace('{STRING}', '\\1', $bbcode_tpl['wiki']);

// [wiki]string for wiki[/wiki] code..
$patterns[] = "#\[wiki\](.*?)\[/wiki\]#si";
$replacements[] = $bbcode_tpl['wiki'];

in bbcode.tpl add...

<!-- BEGIN wiki --><a href="http://en.wikipedia.org/wiki/{STRING}" target="_blank" class="postlink">{STRING}</a><!-- END wiki -->

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Tue Jan 17, 2006 8:45 am

Okay, I did get the original mod working but I had to insert the author's code in a different place.

However, the biggest drawback of this mod is that it only allows a single word to be sent to Wikipedia. This means that common multi-word searches like "John Lennon" or "gold coins" fail, despite the fact that the information is there.

Right now if I enter "strawberry fields forever" this mod builds the following link:

Code: Select all

http://en.wikipedia.org/wiki/strawberry+fields+forever
The correct link would be:

Code: Select all

http://en.wikipedia.org/wiki/strawberry_fields_forever
If the search terms were connected with underscores, all the multi-word examples I mentioned would work. How about a fix for this?
Last edited by beggers on Sat Jan 21, 2006 5:43 am, edited 1 time in total.

guylon
Registered User
Posts: 52
Joined: Fri May 24, 2002 6:47 am
Location: Batavia
Contact:

Post by guylon » Sat Jan 21, 2006 2:35 am

Yeah, this flaw is quite disturbing, anyone would offer something to fix this?

edit: since it's the limitation of urlencode, I guess you'll just have to input the wiki with "_" not spaces. Besides, Don_Juan is available in wiki but not Don_juan.

User avatar
Serlio
Registered User
Posts: 7
Joined: Tue Jan 11, 2005 6:44 pm

Post by Serlio » Fri Feb 10, 2006 7:55 am

I think I've solved the bug. You should replace, in includes/bbcode.php:

Code: Select all

$bbcode_tpl['wiki'] = str_replace('{QUERY}', "' . urlencode(str_replace('\\\"', '\"', '\\1')) . '", $bbcode_tpl['wiki']);
by

Code: Select all

$bbcode_tpl['wiki'] = str_replace('{QUERY}', "' . urlencode(str_replace(' ', '_', str_replace('\\\"', '\"', '\\1'))) . '", $bbcode_tpl['wiki']);
(there could be several lines including similar code depending on the number of languages for wikipedia you have included; you should make the corresponding change for each line).

User avatar
beggers
Registered User
Posts: 1257
Joined: Fri Nov 23, 2001 8:19 pm
Location: Las Vegas
Contact:

Post by beggers » Sat Feb 11, 2006 7:55 am

Serlio, you are da man! It works great now. Thanks.

Post Reply

Return to “[2.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 16 guests