Link to Mod (http://mods.simplemachines.org/index.php?mod=39)
This mod will make the bulletin board code parsing faster.
Hmm... any downsides?
If there aren't it wouldn't make sense to turn this into a mod - it should just be used for the default SMF install...
For now it's a mod, I'm a mod maker. :)
I don't know any downside yet. If you think about it, this function is called lots of times in topics: for message bodies (if there's code blocks, it's called more than once) and signatures, news. Any optimization on it would be very good, so I worked on it for some weeks. In my tests, this one is 20-1000% faster, depending on what it's given to parse.
Just because it's faster doesn't mean there are no downsides. I'm not completely certain it will parse the same, and there's no one it's going into 1.0....
Because, see, the one in there works, mostly. There are a few bugs, but generally speaking it works and for most people. Even if this one is faster, and even does some things better... if there's anything it does worse, it really won't be a good move.
-[Unknown]
Well, I tried to install it, (mostly because I want to install the csv-table mod) but I keep getting failures on the install....
Do you have the publick RC2? If you installed the fixes package, that may be why you get the failure. I'll write a quick update for the mod to install on the fixes one quick.
/me switches to his text editor...
Updated to 1.01
Now it installs fine on RC2 after the fixes patch was applied.
installs fine on rc2 btw. works fine, allways do installs by hand & seems parsing faster.
thx for this mod :)
However the codes in uppercase like [*U] are not parsed anymore in my case [*u] still works.
Maybe a mistake on my side or a small fix ?
:)
What tag gives you that problem? Did it work fine before the mod? It should be case insensitive.
[*U]here [/U] does not work anymore and was working just before the mod introduction. I'll test the others ;) and edit here.
PS [*u] was working and is working anyway.
Edit get the same for COLOR , B. I think this is general. I have tested the BB codes in the board news.
Yeah, I think I know what the problem is. I'll fix it and release the update soon. Sorry for not noticing before.
Updated to 1.02
- Fixed the case sensitivity issue, now it's working with upper or lower case correctly.
I made this release an update instead of a full installer, so you will need 1.01 installed first. The reason for doing it like this was that many other mods are based on this one, uninstalling would have been a lot messier if you had those too.
works very well now thx.
:)
Glad to hear that. :)
Someone asked me why it is faster. The main reason is that it first checks which tags are used in the message passed to it and then only does those.
Works very well and is indeed faster. Thanx !
Im getting this error when I click [Apply Mod] in the package manager...
Quote
Installing this package will perform the following actions:
Type Action Description
1. Execute Modification ./Sources/Subs.php Failure
All I have installed is the public RC2 and the fusebox mod.
Any ideas?
If you've not installed the fixes for RC2, then use 1.00. If you have, use 1.01. After either one, apply 1.02 update. Let me know if that helps. :)
Hi,
thanks for your great MODs!
With FasterParsecode i got a Problem when installing.
After installing 1.01, PaketManager will not let me install the 1.02 Update, cause it says its an old Version (Red Light behind the Mod Name).
Does anyone know what´s the reason for that?
Thanks from Germany!
Tercel
1.02 tells you it's an older version when you have 1.01 installed? weird. Does it give you the link to apply the mod anyway?
No, just - Show Files & Delete. Not funny :-)
But it shows all 3 (incl. Install) when 1.01 is not installed.
Tercel
Man, don´t make yourself trouble, might be a failure due to some Mods, i´ve allready installed:
Mod Name Mod Version
1. Faster Parsecode 1.01 [ Modifikation anwenden ] [ Dateien auflisten ] [ Löschen ]
2. OnLine Users Today 1.1 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
3. Buddy List 1.11 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
4. Fuse Box 1.22 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
5. The Bar Of Experience 1.1 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
6. Faster Parsecode 1.02 [ Modifikation anwenden ] [ Dateien auflisten ] [ Löschen ]
7. Ultimate Shoutbox 1.2 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
8. Message Icon Manager (Quick Reply) 1.2 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
9. Coloured Jumpbox 1.11 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
10. Manage Holidays MOD 1.01 [ Deinstallieren ] [ Dateien auflisten ] [ Löschen ]
11. SMF 1.0 RC2 Fix Package 1.0 [ Dateien auflisten ] [ Löschen ]
When I install 101, embendet Pictures are not shown and Tables are desroyed, even after adding 102 manualy, there´s no clue. It won´t work. But I´m shure this is no problem of your MOD.
Keep on Your good Work - You just can´t have everything in life :-)
Tercel
Hmm... could you post a copy of a message with an image and table the way you had problems with? I'd like to test this.
Won't let me install this mod at all....
Perhaps because I'm using 1.0 pre?
Quote from: Eris Siva on November 21, 2004, 03:29:46 AM
Won't let me install this mod at all....
Perhaps because I'm using 1.0 pre?
Yes. I'll release the next version when SMF 1.0 gets released publicly. Soon. :)
Of course
[table]
[tr]
[td]
[url=http://...maddogs.info][img width=38 height=38]http://independence-somewhere/Bilder/erv_schweinfurt.jpg[/img][/url][hr][/td]
[td]Schweinfurt Mad Dogs[hr][/td]
[td][url=http://...maddogs.info]...maddogs.info[/url][br][url=http://independence-hockey.com][b]INDEPENDENCE[/b][/url][/td]
[/tr]
[tr]
[td]
[url=http://...bayreuth-tigers...][img width=38 height=38]http://independence-somewhere/Bilder/bayreuth_the_tigers.jpg[/img][/url][hr][/td]
[td]Bayreuth Tigers[hr][/td]
[td][url=http://...bayreuth-tigers...]...bayreuth-tigers...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...bschc-preussen...][img width=38 height=38]http://independence-somewhere/Bilder/bschc_preussen_60.gif[/img][/url][hr][/td]
[td]Berliner SCHC Preussen[hr][/td]
[td][url=http://...bschc-preussen...]bschc-preussen...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...revier-loewen...][img width=38 height=38]http://independence-somewhere/Bilder/revier_loewen.jpg[/img][/url][hr][/td]
[td]Revier Löwen Oberhausen[hr][/td]
[td][url=http://...revier-loewen...]...revier-loewen...[/url][br][url=http://...revierloewenfans.../]...revier-loewenfans...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...ehc-le...][img width=38 height=38]http://independence-somewhere/Bilder/blue_lions_leipzig.jpg[/img][/url][hr][/td]
[td]Blue Lions Leipzig[hr][/td]
[td][url=http://...ehc-le...]...ehc-le...[/url][br][url=http://82.97.68.153/startseite.php]Hauptseite[/url][/td]
[/tr]
[tr]
[td]
[url=http://...eisbaerenjuniors...][img width=38 height=38]http://independence-somewhere/Bilder/eisbaeren_juniors.jpg[/img][/url][hr][/td]
[td]Eisbären Juniors e.V. Berlin[hr][/td]
[td][url=http://...eisbaerenjuniors...]...eisbaerenjuniors...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...eisloewen.com][img width=38 height=38]http://independence-somewhere/Bilder/esc_dresden.jpg[/img][/url][hr][/td]
[td]Dresdner Eislöwen[hr][/td]
[td][url=http://...eisloewen.com]...eisloewen.com[/url][br][url=http://...eisloewen...]...eisloewen...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...hannover-eishockey...][img width=38 height=38]http://independence-somewhere/Bilder/hannover_indians.jpg[/img][/url][hr][/td]
[td]Hannover Indians[hr][/td]
[td][url=http://...hannover-eishockey...]...hannover-eishockey...[/url][br][url=http://...kev-hannover-indians...]...kev-hannover-indians...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...hassfurt-sharks...][img width=38 height=38]http://independence-somewhere/Bilder/erc_hassfurt.jpg[/img][/url][hr][/td]
[td]Hassfurt Sharks[hr][/td]
[td][url=http://...hassfurt-sharks...]...hassfurt-sharks...[/url][br][url=http://...sharks-fans.info/forum/index.php]...sharks-fans.info/forum/index.php[/url][/td]
[/tr]
[tr]
[td]
[url=http://...hoechstadt-alligators...][img width=38 height=38]http://independence-somewhere/Bilder/hoechstadt_alligators.jpg[/img][/url][hr][/td]
[td]Aischtal Alligators Höchstadt[hr][/td]
[td][url=http://...hoechstadt-alligators...]...hoechstadt-alligators...[/url][/td]
[td] [/td]
[/tr]
[tr]
[td]
[url=http://...sc-mittelrhein...][img width=38 height=38]http://independence-somewhere/Bilder/scmittelrhein.jpg[/img][/url][/td]
[td]Mittelrhein Bären[hr][/td]
[td][url=http://...sc-mittelrhein...]...sc-mittelrhein...[/url][/td]
[td] [/td]
[/tr][/table]
[b]Oberliga Süd[/b][hr]
[table]
[tr]
[td]
[url=http://...starbulls...][img width=38 height=38]http://independence-somewhere/Bilder/star_bulls_rosenheim.jpg[/img][/url][hr][/td]
[td]Starbulls Rosenheim[hr][/td]
[td][url=http://...starbulls...]...starbulls...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...ehc-muenchen.com][img width=38 height=38]http://independence-somewhere/Bilder/ehc_muenchen.jpg[/img][/url][hr][/td]
[td]EHC München[hr][/td]
[td][url=http://...ehc-muenchen.com]...ehc-muenchen.com[/url][/td]
[/tr]
[tr]
[td]
[url=http://...ec-peiting...][img width=38 height=38]http://independence-somewhere/Bilder/ec_peiting.jpg[/img][/url][hr][/td]
[td]EC Peiting[hr][/td]
[td][url=http://...ec-peiting...]...ec-peiting...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...evr-online...][img width=38 height=38]http://independence-somewhere/Bilder/ev_ravensburg.jpg[/img][/url][hr][/td]
[td]EV Ravensburg[hr][/td]
[td][url=http://...evr-online...]...evr-online...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...stuttgart-wizards...][img width=38 height=38]http://independence-somewhere/Bilder/stuttgart_wizards.jpg[/img][/url][hr][/td]
[td]Stuttgart Wizards[hr][/td]
[td][url=http://...stuttgart-wizards...]...stuttgart-wizards...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...ev-fuessen...][img width=38 height=38]http://independence-somewhere/Bilder/fuessen.jpg[/img][/url][hr][/td]
[td]Leopards Füssen[hr][/td]
[td][url=http://...ev-fuessen...]...ev-fuessen...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...ehc-klostersee...][img width=38 height=38]http://independence-somewhere/Bilder/ehc_klostersee.jpg[/img][/url][hr][/td]
[td]EHC Klostersee[hr][/td]
[td][url=http://...ehc-klostersee...]...ehc-klostersee...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...tev-miesbach...][img width=38 height=38]http://independence-somewhere/Bilder/tev_miesbach.jpg[/img][/url][hr][/td]
[td]TEV Miesbach[hr][/td]
[td][url=http://...tev-miesbach...]...tev-miesbach...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...scr...][img width=38 height=38]http://independence-somewhere/Bilder/sc_riessersee.jpg[/img][/url][hr][/td]
[td]SC Riessersee Garmisch-Partenkirchen[hr][/td]
[td][url=http://...scr...]...scr...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...heilbronner-falken...][img width=38 height=38]http://independence-somewhere/Bilder/heilbronner_falken.jpg[/img][/url][hr][/td]
[td]Heilbronner Falken[hr][/td]
[td][url=http://...heilbronner-falken...]...heilbronner-falken...[/url][/td]
[/tr]
[tr]
[td]
[url=http://...esv-huegelsheim.../][img width=38 height=38]http://independence-somewhere/Bilder/esv_huegelsheim.jpg[/img][/url][/td]
[td]ESV Hügelsheim Hornets[hr][/td]
[td][url=http://...esv-huegelsheim...]...esv-huegelsheim...[/url][/td]
[/tr]
[/table]
Just like this.
Cu Tercel
Thank for finding that Tercel, I should've have checked the table parsing when this problem was found in my CSV tables mod.
I'm uploading an update in a moment.
BTW, found a way around the no apply-mod link in the packages browser. Upload the package using the form in the Download New Packages area, right after doing it you'll be given the option to apply it. Even if you get a warning in the preview, you still have the proceed link, which will apply the mod without a problem. ;)
1.03
- Fixed a problem with images and links inside tables.
Question:
Is 1.03 an update to 1.02 (in other words, do we install over 1.02 or uninstall 1.02 before installing 1.03?)
Quote from: kindred on November 22, 2004, 09:46:31 AM
Is 1.03 an update to 1.02 (in other words, do we install over 1.02 or uninstall 1.02 before installing 1.03?)
It's in addition to 1.02. They handle different things and you need them both. 1.02 was for the tag's case sensitivity and 1.03 for the parsing inside tables.
@Anguz
The pictures inside the tables are shown now.! ;D
But - somehow your code inserts too much <br />'s where no <br> is in the message. Everytime when a new line´s beginning in the original, the script inserts them. This causes more Carriage Returns than Jerry Lewis did in his typewriter Comedy :D
What happens:
for ex.:
[tr] -> <tr><br />
[td] -> <td><br />
like this you get 2 empty lines inside the table, where they shouldn´t be.
There are also some Spaces I donna know where they come from: This is the resulting HTML!
<hr /><br /><table><br /> <tr><br /> <td valign="top"><br /> <a href="
Hope I could help U
CU! Tercel
SMF turns newlines in messages into <br />s. If you have <br />s after the <td>s and <hr />s, that's because you put a newline after the [td]s and [hr]s, respectively. I checked and there's no <br />s after the <tr>s or <table>s. I checked this with the message you provided in reply 26 (http://www.simplemachines.org/community/index.php?topic=18659.msg162949#msg162949).
So I´d have to edit my messages... :(
Let´s see how much Coffee is in the House ;)
CU Tercel
They all work until 1.03 then:
Parse error: parse error, expecting `')'' in /home/www/xbfclan.freesuperhost.com/forum/Sources/Subs.php on line 833
Is is because I'm using MkPortal and I edited my default subs so it could work? I'm running RC2 with the patch
Heres the site with the errors: http://www.xbfclan.tk
Never mind I fixed it. The 'match a table' code was inside the code_to_from array( thing and it wanted an ending ) for it. I just moved it above that array( stuff and it doesn't give me error, but will it still work?
EDIT: Never mind it doesn't work, whats wrong? Now the smilies wont work on my forum when posting, neither will the other buttons. The smilies and all the stuff appear on my previous posts, but I can't put them into posts via the buttons. This is annoying, I might just go back to my earlier subs.php. Is anyone else having a problem with 1.03?
Hmm... did you install 1.01 first? 1.02 and 1.03 don't replace 1.01. First install 1.01, then 1.02 and 1.03. I'm asking this cause you mentioned the $code_to_from array, which is in the original parsecode function, not in mine.
I accidentaly installed 1.00, then the others. After realizing my mistake I uninstalled all of them and replaced my subs.php with the back-up. Then I did 1.01 and so on. I just uninstalled them, but I'll try it in order again.
EDIT: Okay installed the mod by hand and it worked without errors. I'm still getting problems with adding smileys and such to my posts. Can anybody help me or analyze my subs.php for me?
If you could please save a copy of your Subs.php as .txt or zipped in your server and PM me the URL to it, I'll take a look at it. Do you have any other mods installed?
okay go here: http://xbfclan.freesuperhost.com/index.php?ind=downloads&op=entry_view&iden=1
And download it from my site. If you find the problem you can upload it back up to the site through that URL, just put it in the support section. I do have the following mods installed:
1. SMF 1.0 RC2 Fix Package 1.0
2. Visual Warning / Post Moderation 1.2
3. Topic Solved 1.2
And I also had hide text installed, but I removed it because it wouldn't work with my theme.
Thanks. Could you also post a message with which you're having the problem in your forum so I can test it here?
Okay heres the message: http://xbfclan.freesuperhost.com/forum/index.php?topic=11.msg14
There are no problems in parsing it, but the buttons would not work. You would have to try this to see what I mean so use my test account
name: itakeabuse
pass: test
Other members please don't abuse this, although this is a pretty nice forum.
I see what you mean. The thing is that the buttons are in a totally different file, Faster Parsecode doesn't touch that at all. Are you sure you didn't change anything else? Did you try using other themes and see if they also don't work? I ask cause the JS for the snow flakes could be affecting it. I don't know how this mod could be causing that problem you have. :-\
Thanks for trying anyways. It's probably an issue with MkPortal or something, I'll reinstall SMF later today as soon as my host gets the databases back online! >:(
@anguz
I do not know whethet this is exactly the right place to post that as it is more an extension of your mod than a real remark about it, anyway.
I would like to be able to post directly some links of this form exactly like http (the | and / are important).
bzzk://|file|myfile|736286526|A7E9ED9687E2DBDFEB00CC7AA282F558|/
OK I can add at the right line bzzk right after http but it will take only this part as the link bzzk://|file|myfile and not the other characters in the string.
I have done 2 things
1) use HTML tag and works OK
2) use custom BB code
but my users complain when they have a list to post : they would like to just make a cut and paste.
Sorry for my poor english :)
Try the code BB code. It looks like this: # and it does this:
bzzk://|file|myfile|736286526|A7E9ED9687E2DBDFEB00CC7AA282F558|/
am totally confused how do i install the mod which version ? have updated the patches for the Php will that be a issue newbie here www.bangaloreforums.com
Quote from: shishira on December 23, 2004, 10:42:31 AM
am totally confused how do i install the mod which version ? have updated the patches for the Php will that be a issue newbie here www.bangaloreforums.com
Quote from: Anguz on December 12, 2004, 01:23:50 AM
1.02 and 1.03 don't replace 1.01. First install 1.01, then 1.02 and 1.03.
:)
it dosen't let me install 1.03 there is no install option installed 1 2
you need to download and install 1.01 then you install the rest.
now it say
Parse error: parse error, unexpected T_IF, expecting ')' in /home/shishira/public_html/bangaloreforums/Sources/Subs.php on line 833
Could you copy/paste that line? And one or two before/after it as well.
Regarding it not letting you install 1.03, what does it say?
it installed fine couldn't get acess to the site at all there was a sub.php~ file in the sources direstory renamed it as sub.php and its working fine was wondering if u could fuse all the three files 1.01 and the rest into one singe pack think that will be easier will mail u bith the files thanks
have pasted the code as u requested let me know if u need to access the site
Quote// Fix things.
$message = strtr($message, array(' ' => ' ', "\r" => '', "\n" => '<br />'));
return $message;
}
// Parses the code in message, using the normal syntax used by some many forums...
function parsecode(&$message)
{
global $modSettings, $scripturl, $txt, $settings, $context;
static $codefromcache = array(), $codetocache = array();
// If it wasn't already set, set it.
if (empty($codefromcache))
{
// If any tags are disabled then we won't add them.
if (!empty($modSettings['disabledBBC']))
{
$disabled = array_flip(explode(',', $modSettings['disabledBBC']));
foreach ($disabled as $tag => $dummy)
$disabled[trim($tag)] = true;
}
$code_to_from = array(
// Match a table... hopefully with everything in the right place.
if(isset($add['']) && isset($add['']) && isset($add[''])){ $arr1[] = '~\[table\](.*?)\[/table\](?:\s|\xA0|<br />| )?~ie'; $arr2[] = '\'<table>\' . parse_table(\'$1\') . \'</table>\''; } // A named email address. me ([email protected]) '~\(.+?)\[/email\]~ie' => isset($disabled['email']) ? '$2 ($1)' : '\'<a href="mailto:$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\])~\', \'\', strtr(\'$2\', array(\'@\' => \'@\'))) . \'</a>\'', // Find an inside link. (named?) ie. [iurl=http://www.simplemachines.org]www.simplemachines.org[/iurl] '~\[iurl=([^\]]+?)\]([^\[\]]+?)\[/iurl\]~i' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '<a href="$1" target="_blank">$2</a>' : '$2 ($1)') : '<a href="$1">$2</a>', '~\[iurl=(.+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '\'<a href="$1" target="_blank">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'@\'))) . \'</a>\'' : 'preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \' ($1)\'') : '\'<a href="$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', strtr(\'$2\', array(\'@\' => \'@\'))) . \'</a>\'', '~\[iurl\](.+?)\[/iurl\]~i' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '<a href="$1" target="_blank">$1</a>' : '$1') : '<a href="$1">$1</a>', // FTP link. Named...? [ftp=ftp://upload.sourceforge.net]Sourceforge[/ftp] ((.+?)\) |
From what you posted, 1.01 is not installed.
well, it's killed my site. tried fixing, but no luck. now i have to delete site.
happy christmas.
bye
all you need to do is upload fresh copies of /Sources/Subs.php or delete the ~ of the backup file for it and it should be gone ;)
Quote from: eSolutionsWork on December 26, 2004, 09:43:43 AM
well, it's killed my site. tried fixing, but no luck. now i have to delete site.
happy christmas.
bye
How did you manage to do that? Well, Faster Parsecode
only touches Subs.php, like Jerry mentions. At most, the page is not displaying because of an error in the code that displays the content, but it's all there, just restore Subs.php. If when you're installing the package, a step of the install in the preview indicates failure, don't proceed! I'd like to know what you mean by "killed my site" and what you did to install it in order to help you. If the package installation goes fine, the mod works pretty well, as can be seen from the many downloads and little problems. Still, I don't discard that there may be a problem, but I need more information.
honestly fuse all the three packages into one and we should be doing fine. Trying out them again tonight could i have ur email ID plz
Quote from: shishira on December 26, 2004, 02:37:18 PM
honestly fuse all the three packages into one and we should be doing fine. Trying out them again tonight could i have ur email ID plz
You can PM me here.
http://www.simplemachines.org/community/index.php?action=pm;sa=send;u=76
I'll post later an updated version, still for RC2, to integrate 1.01, 2 and 3 into one.
Updated to 1.04
- Put 1.01, 1.02 and 1.03 together in one for those that are installing for the first time instead of updating.
Is this required for the Final version ?!
Quote from: Webby on January 02, 2005, 10:20:50 AM
Is this required for the Final version ?!
You mean SMF 1.0? Not required! It is for other mods of mine that depend on this one, yes. I haven't updated the packages to SMF 1.0 yet, though.
yes, anxiously waiting on it! THANKS!
ok i've been trying myself for ages so i'm gonna come out and ask..
i can't for the life of me get this thing to install. I've got other mods to work but when i try to install version 1.04 all i get is "There are no installation or uninstallation instructions defined"
Any help with this would be much appreciated
Devilfish
What SMF version are you using?
its the latest version.. 1.0 final i believe?
That may be why. Faster Parsecode is still for RC2, I haven't updated it yet. I've been too busy lately and will be for a few more days, but will get to it as soon as I can.
oh sorry...
thats my bad :-[
anyway.. i like the idea... i'll be waiting with baited breath for the update :)
Quote from: Anguz on January 03, 2005, 05:13:21 AM
That may be why. Faster Parsecode is still for RC2, I haven't updated it yet. I've been too busy lately and will be for a few more days, but will get to it as soon as I can.
Seems to work no problem with SMF1.0, sorry I just installed to see if it still worked. ..
There were some changes in the parsecode function which I have to update in my mod one. There's also some new stuff I'm planning to add. ;)
Alright, can't wait :)
I'll wait for it..... also because of the fact I want to implement the Custom BB Code mod......
waiting waitin waiting ;D
and anticipating ;)
I have been trying to install this mod for some time now, but I always get this error when trying to install:
Package Manager - Install Actions
Install Actions for archive FasterParsecode104.tar.gz:
There are no installation or uninstallation actions defined!
He has yet to upgrade the package for SMF1.0 FINAL
I used to get the same error when trying to install it on RC2 as well.
He prob didn't upgrade that script when you tried it as well... :P
Little bump :P
I really want this so then I can get the spoiler tag.
Which of the downloads do I need for this to work? Has it been updated for 1.0.1?
not yet....
uploaded and installed it asked for the ftp password to chmode the subs.php
how do i make sure that the mod has been installed
thanks for the cooooolest mod
and the speed of the board is super fast compared to before
long live ANGUZ
Glad you like it shishira. :)
Well, the package manager should say if the mod is installed.
it does 8) 8) 8)
I keep getting a Failure error when appying the mod.
[edit]
n/m, I went ahead and did it manually.
What version is your SMF? And could you tell me what the error you were getting was? Would like to check it out to make sure it's not a problem others may get too. Thanks! :)
Wasn't any errors.
I am using 1.0.1.
It works perfect after I manually installed it though.
That's good to know. :)
What I meant was, what error did you get when you tried to install it using the package manager that made you do it manually.
Updated to 1.06
- Fixed a bug that caused a quote with a code block in it to not be closed properly.
question:
If I have installed FasterParseCode AND several of the other mods that require trhe faster parse code... do I have to uninstall all of them and the reinstall from fasterparsecode up again?
I'm thinking yes... so an "update mod" would be extremely useful...
I'll post an update mod tonight.
Thanks Anguz, you're the coolest. :)
kindred, please download the 1.06 package again, it now includes an upgrade from 1.05 if that version is found to be installed. ;)
Is there anyway to manualy install this? I was installing a load of mods I downloaded, and I though I had this isntalled. only to find I didn't and toasted my forums.
If you installed another mod that affects the parsecode function, then it would be a bit more trouble. If you didn't isntall something that modified that, then I don't understand why you can't install with the package manager. But, yes, you can install manually. Open the package and read the .mod file.
yes. the parsecode doesnt work with 1.02. I tried to reload it after the upgrade and got sub.php file errors ???
Quote from: Anguz on February 15, 2005, 10:25:25 PM
If you installed another mod that affects the parsecode function, then it would be a bit more trouble. If you didn't isntall something that modified that, then I don't understand why you can't install with the package manager. But, yes, you can install manually. Open the package and read the .mod file.
Well I can't get at the package manager because it justsays:
Parse error: parse error, expecting `')'' in d:\domains\lordkane.co.uk\wwwroot\forums\Sources\Subs.php on line 891
edit: I sorted it by opening up the subs.php in notpad and removing the offending lines. I then was able to isntall the parsecode mod, and reinstall the offending mod. Thanks.
Quote from: trenchteam on February 16, 2005, 05:42:50 AM
yes. the parsecode doesnt work with 1.02. I tried to reload it after the upgrade and got sub.php file errors ???
I still have to check the code for 1.0.2 and update my mod for it.
Using 1.0.2 and got this error with 1.07:
2: copy(/usr/home/web/web30259/Sources/Subs.php~): failed to open stream: Permission denied
File: /usr/home/web/web30259/Sources/Subs-Package.php
Line: 1427
Quote from: Gawc on March 18, 2005, 12:43:30 PM
Using 1.0.2 and got this error with 1.07:
2: copy(/usr/home/web/web30259/Sources/Subs.php~): failed to open stream: Permission denied
File: /usr/home/web/web30259/Sources/Subs-Package.php
Line: 1427
Set your permissions correctly via FTP. :)
2: fopen(): SAFE MODE Restriction in effect. The script whose uid is 2057 is not allowed to access /home/ocm/site/vhost/forum/Packages/temp owned by uid 99
Plik: /home/ocm/site/vhost/forum/Sources/Subs-Package.php
Linia: 1454
what i can do about that ?
Quote from: Krispl on March 25, 2005, 09:18:12 PM
2: fopen(): SAFE MODE Restriction in effect. The script whose uid is 2057 is not allowed to access /home/ocm/site/vhost/forum/Packages/temp owned by uid 99
Plik: /home/ocm/site/vhost/forum/Sources/Subs-Package.php
Linia: 1454
what i can do about that ?
http://www.simplemachines.org/community/index.php?topic=28393.0
-[Unknown]
Install Actions for archive FasterParsecode107.tar.gz:
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Does not like to be installed on SMF 1.0.3. but works from any older version that was upgraded to the newest version
Not updated for 1.0.3 yet.
when will it be updated for 1.0.3?
Quote from: duconihilum on April 03, 2005, 03:33:06 PM
when will it be updated for 1.0.3?
Soon. I apologize, I have to finish some work before I can do this.
Quote from: Anguz on April 03, 2005, 10:49:10 PM
Quote from: duconihilum on April 03, 2005, 03:33:06 PM
when will it be updated for 1.0.3?
Soon. I apologize, I have to finish some work before I can do this.
If you have it running before you ugrade it seems to take fine
It works for 1.1+ ? :P i'm tempted to install it :)
Quote from: Omar Bazavilvazo on April 09, 2005, 06:24:36 PM
It works for 1.1+ ? :P i'm tempted to install it :)
Hey, Omar. I haven't tested it yet. I'll download 1.1 Beta 1 today and take a look at the function.
Quote from: Anguz on April 09, 2005, 07:19:19 PM
Quote from: Omar Bazavilvazo on April 09, 2005, 06:24:36 PM
It works for 1.1+ ? :P i'm tempted to install it :)
Hey, Omar. I haven't tested it yet. I'll download 1.1 Beta 1 today and take a look at the function.
Great! :)
Any Idea on a time frame for a Updated Parsecode that will work with SMF 1.0.3
Thanks
Quote from: Anguz on April 19, 2005, 08:40:39 PM
1.08
yay! i am the first one to install it, but it is a failiure
Type Action Description
1. Execute Modification ./Sources/Subs.php Failure
You probably have installed another mod that affected the parsecode function in Subs.php.
it works for 1.1? :P
Should we update it if we had 1.07 before the SMF 1.0.3 update?
Quote from: Lamer on April 23, 2005, 01:04:43 AM
Should we update it if we had 1.07 before the SMF 1.0.3 update?
No need to.
Quote from: Anguz on April 20, 2005, 08:39:03 AM
You probably have installed another mod that affected the parsecode function in Subs.php.
i got the same error he did and i checked all the other mods and none of them mess with subs.php
I wonder if it's a whitespace issue. It's working for me. You can apply it by hand if the package doesn't work, but then the install will also have to be by hand.
Hi,
I get the following error, when wanting to install the faster parsecode
mod on the same hosting server, that already suceeded in it to install
with a different domain.
I already used fix_ownership.php and repair_settings.php
and when I try to install in SMF1.03 the mod at the step when it says:
Install Actions for archive FasterParsecode108_SMF103.tar.gz:
Installing this package will perform the following actions: Type Action Description
1. Execute Modification ./Sources/Subs.php Success
[ Proceed ]
When I press then the Proceed link it gives the error:
An Error Has Occurred!
2: copy(/home4/sub002/sc11940-GNVW/dasalteberlin/Sources/Subs.php~): failed to open stream: Permission denied
File: /home4/sub002/sc11940-GNVW/dasalteberlin/Sources/Subs-Package.php
Line: 1449
Could it be, that it is the case, because I am in Safe Mode now ?
But before it work on my other domain overunity.com
with the same procedure...
hmmm, maybe my hoster has now switched to safe mode ?
Before, the Safe Mode was off due to php_info.php
hmmm...
Any ideas ?
Many thanks.
Regards, Stefan.
Can I somehow execute this:
FasterParsecode108.mod
manually ?
Or will then the same error code appear ?
Hmm, with my other domain on the same hosting machine
the mod went through without any problems and I think now,
safe mode was also ON there already...
Hmm, why does this execution of the mod does not work now ??
hartiberlin,
I think it's failing because your Sources directory is not writable. The bit that's failing is actually the backup - you can disable that from the package manager settings (Tell it not to backup files before making changes if you wish).
You can manually make the changes in the mod by basically downloading a copy of your forum files to your local computer, making the changes by hand, and uploading them. The mod file is pretty human readable.
Grudge
Hi,
you were right.
The directory was set only to 755.
I change it to 777 but this did also not let it install.
Then I removed the Backup files function under Install option
and now it went through...
Hmm. I wonder why it went through without this hassle with my other domain... ?
Hmm, maybe I did set the permissions there already all to 777 ?
Anyway thankd for your help.
One last question:
Is it safe to have all files and directories set to 777 in the forum directory ?
Regards, Stefan.
Now , when finally installing the custom BB code
mod thereis another error:
An Error Has Occurred!
2: fopen(/home4/sub002/sc11940-GNVW/dasalteberlin/Themes/default/languages/Help.english.php): failed to open stream: Permission denied
File: /home4/sub002/sc11940-GNVW/dasalteberlin/Sources/Subs-Package.php
Line: 1476
But the backup files function is still off.
I am now trying to set all directories and files to 777.
By the way, what is the UID / GID permission for ?
http://www.simplemachines.org/community/index.php?topic=2987.0
Setting the files and directories to 777 fixed also this error.
Hmm, now I wonder if it is really save to let all the files
being 777 permission ?
And waht is the GID / UID permission for which I can set in SmartFTP ?
Thanks.
Why chmod 777 is NOT a security risk (http://www.simplemachines.org/community/index.php?topic=2987.0)
-[Unknown]
I have now installed the Faster Parsecode and ModSettingsTextarea and
finally the cutom BB code mod
and
now I have under:
Edit Features and Options
4 times the
Custom BB Code tags
listed.
Why is this ?
P.S: How can I attach a picture here to show this ?
Under additional option I don´t have an "attach file" option !
1.08 doesn't work for SMF 1.0.4, right?
When will a version for 1.0.4 be out? :)
Thanks ^_^
Not, it doesn't work. 1.0.4 changes the parsecode function iirc and I need to update my mod with that. No date, but I'll work on it soon.
Wee, you're the man!
I'll look forward for it;)
Does this have any purpose/advantages with SMF version 1.0.4? Thank you
Quote from: d3v on June 11, 2005, 12:30:30 AM
Does this have any purpose/advantages with SMF version 1.0.4? Thank you
well, several mods are dependent on this mod to work, namely the "spoiler tag" and "custom bb code" mods.
also, the "streaming" mod.
i await an update dear Anguz :)
Faster Parsecode is also required for the excellent mod Table From CSV (http://www.simplemachines.org/community/index.php?topic=18917.0).
I don' t yet update to 1.04 as this mod is a must, if your subjects require tables in the messages.
works fine with 1.0.4 here
What works fine and where?
Quote from: d3v on June 15, 2005, 04:58:45 PM
works fine with 1.0.4 here
catchmydr1ft.com/smf - 1.0.4 with Faster Parsecode mode. Just changed the .xml file setting to 1.0.4
Or maybe it doesn't do anything.... ???
Same here, I am still waiting for this mod to be compatable with 1.0.4.
I'm waiting too :(
i'll never update till most of my mods are updated too.
I have edited .xml file but i got that:
Installing this package will perform the following actions: Type Action Description
1. Execute Modification ./Sources/Subs.php Failure
[ Proceed ]
so is this working for 1.04 I want the hide tags back!
Well it was but now we're up to 1.0.5 and I don't think it works :'(
I'll be glad to see some words from Anguz, what he thinks about update this mod.
May be he waits for SMF 1.1 to finalize this mod?
Just cause other mods need Faster Parsecode to be installed.
Well, the install will not work on 1.0.4 or 1.0.5, because 1.0.4 changes the code that the mod looks to orient itself...
However, if you installed on 1.0.3 and want to upgrade to 1.0.4, [unknown] has released a special upgrade just for you...
(and 1.0.5 doens't touch this code, so, the upgrade to 1.0.5 should be easily done through the package manager.
I apologize for the lack of update on my mods. I have been very busy with my life and I haven't had time for my SMF code. I'm not planning to wait for 1.1 final to be released to do it, though, I just haven't had the time yet. Regarding 1.1, it has a completely new parsecode function written by [Unknown] and in all honesty, if I haven't had much time to change a version number to my mods, much less will I probably re-write the whole code again, so FasterParsecode will more probably remain for 1.0.x only. I know that the tags that depend on it are very used by many, so I plan write those for 1.1, don't worry. Sorry again for taking my time with this, many of you must know how supporting a family can be, money and timewise. I hope I'll have these mods updated soon.
That realy made me happy!
Thanks Anzug and take your time
I've problem with Faster Parsecode 1.08 with SMF 1.0.5 (Still running on 1.0.3)
Anyone knows?
due that since 1.0.4 that code changed, as stated before, this mod won't work
Quote from: huijaa on June 30, 2005, 04:53:07 PM
I've problem with Faster Parsecode 1.08 with SMF 1.0.5 (Still running on 1.0.3)
Anyone knows?
You're in luck. I privately upgraded it to 1.0.5. I posted in some other topic, but figured I better post it here as well.
http://www.anetcity.com/bbs/index.php?topic=999.0
Or, if the server is down, download it directly & rename it with .zip extension:
http://www.anetcity.com/bbs/attachments/279_FasterParsecode108_SMF105_zip7139ff5467ac5255f17d31feee7bebdd
Works super with 1.0.5 !
Thanks Sheepy
Quote from: Sheepy on June 30, 2005, 07:24:38 PM
Quote from: huijaa on June 30, 2005, 04:53:07 PM
I've problem with Faster Parsecode 1.08 with SMF 1.0.5 (Still running on 1.0.3)
Anyone knows?
You're in luck. I privately upgraded it to 1.0.5. I posted in some other topic, but figured I better post it here as well.
http://www.anetcity.com/bbs/index.php?topic=999.0
Can it install with package manager?
just download it in folder Packages http://www.anetcity.com/bbs/index.php?topic=999.0
and then use package manager to install
Quote from: ivo2296 on June 30, 2005, 09:11:53 PM
Works super with 1.0.5 !
Thanks Sheepy
same here!
thank you very much!!
*goes to install spoiler tags* (which is updated to 1.0.5 as well. did it myself. very simply by changing the xml file)
Wow! I've been waiting for this! I was hoping that the upgraded version would come out before I upgrade my forum in about a week, and this is perfect! I haven't tried it out yet, but I'm going to soon. Do I uninstall the previous version and then uploadthis one?
-Shayna
Quote from: stargazer_1017 on July 01, 2005, 05:45:54 PMDo I uninstall the previous version and then uploadthis one?
Yes you'll have to, I afraid... and it can get messy if you installed some custom tags. Perhaps someone can make an upgrade mod? Text diff should make it a simple job. (I'm trying to batch-process multiple member group info...)
So I should uninstall all of the previous codes that use Faster Parsecode (Language tags, spoiler tag, etc.) and then the old version, and then reinstall from there? I'm sorry to be sounding so stupid, but I want to make sure before I go ahead.
With all the other mods, I just can just change the xml files, right?
-Shayna
Thanks, it works now greatfully....
Sheepy, I know you did it to help, but there's a couple of things I want to point out:
- I wrote this mod and you didn't ask for permission to alter and distribute it, so please remove the file from your server.
- You changed the order of the code parsing, which may give unexpected problems.
I suggest that those that installed Sheepy's, uninstall it and use mine, please. I wasn't planning to spend time on this yet, but I had to make sure no problems would arise from the wrong code.
As a bonus to apologize for the long time it took me to do this update, I added an upgrader from version 1.08 to the package, which may save you the trouble of unistalling tag mods. I didn't have a forum to test the upgrade, though, so please let me know how that goes to know if it's fine or I need to fix something.
1.09
- Updated for SMF 1.0.5.
- Includes an upgrader from version 1.08.
FasterParsecode109_SMF105.tar.gz (http://mods.simplemachines.org/index.php?a=download;mod=39;id=8072)
I thought I'd update the tag mods now as well, but it took longer than I expected to do this one, so I'll work on more tomorrow. I'll try to do all my other 14 mods in the next couple of days.
Hi,
I am still using SMF 1.03
with Fasterparsecode 1.08.
So what is now the best method to upgrade top SMF 1.05 ?
Should I first install the Fasterparsecode 1.09 and then
upgrade SMF to 1.05 from the admin section ?
What about the ModSettingsTextarea MOD ?
As this was required for Fasterparsecode 1.08 must this also be updated
or not ?
Many thanks to Anguz for the MOD update !
Regards, Stefan.
I'd suggest you first backup, try upgrading to SMF 1.0.5 and then FasterParsecode 1.09 without uninstalling 1.08 or the tag mods.
That's for those that like upgrading with all their mods still installed, I personally prefer uninstalling them all first, upgrading and then re-installing, but that's me.
Thank you, Anguz :) I'm one of those people that like to upgrade without installing the mods ;D I still haven't gotten the chance to try it yet, but I will soon. I'll also wait for the updates on the other mods.
-Shayna
Quote from: Anguz on July 02, 2005, 05:49:00 AM
Sheepy, I know you did it to help, but there's a couple of things I want to point out:
I wrote this mod and you didn't ask for permission to alter and distribute it, so please remove the file from your server.
Sure, it's done. With an apologise.
Sorry for not asking you first. I hope it didn't make you angry. :( I had multiple site that need to be updated, so I helped myself... and, perhaps too quickly, others.
Quote from: Anguz on July 02, 2005, 05:49:00 AM
You changed the order of the code parsing, which may give unexpected problems.
Hmm. My thought is that since the lines are changed anyway, I might as well rearrange the email so they stick together and will be easier to read. I should have been aware that this may cause problems. Sigh. So many traps...
No problem. I know I took too long to update, sorry about that. Thank you for removing the package. On the parsing order, it is pretty important in some cases.
Hi!
I'm very happy that this has been upgraded but I'm having a little problem here... We have SMF 1.0.5 and I can upload the mod with no problem, only it won't install. I get this:
Execute Modification ./Sources/Subs.php Failure
Is there any reason for this? All files have attrib 777...
I proceeded anyway, but when I installed the spoiler tag it crashed my board (luckily I had a backup of the subs.php)
Do you have other mods previously installed? It may be that another one changed the function before you tried installing mine and that's why it fails.
I had to replace Subs.php. So it's working now! Thanks. :)
But one more thing... it does work under IE, but for some reason I get errors in the javascript console in Firefox (script not defined?). Any idea here?
Edit works now... weird :P
Faster Parsecode doesn't use JS, but spoiler does. The JS code for it goes in the default theme's script.js file. Maybe the browser was using a cached version of the file at first and then got the modified one.
Can you uninstall Faster Parsecode? I clicked uninstall, and for some reason, the modifications on Subs.php fails. I also noticed that when I upgraded to 1.0.4., the Subs.php failed as well.
I'm currently at 1.0.4. right now, but I'm afraid to move forward.
-Shayna
You need to uninstall the other mods first I think.
Quote from: Phoenixoverlord on July 11, 2005, 03:18:34 AM
You need to uninstall the other mods first I think.
Yup. Otherwise, the Faster Parsecode package doesn't find the code it installed, cause it was modified by yet another mod. So remove the mods in the reverse order you installed them and it should go smoothly.
Ahh *nods* Okay, I found out what the problem was. I think I had Faster Parsecode, Language Tag, and Spoiler tag on and I just deleted the Spoiler tag. No wonder it didn't work when I tried deleting the Faster Parsecode.
-Shayna
I've never used faster parse code, but I have a load of mods and I keep getting FAILURE in the SUBS. How can I install this manually?
bump.
Quote from: trenchteam on July 24, 2005, 04:54:45 AM
I've never used faster parse code, but I have a load of mods and I keep getting FAILURE in the SUBS. How can I install this manually?
Hi Trenchteam. Sorry, I've been moving the last 2 weeks and without internet for days.
To do it manually, you have to open the mod file in the package and follow the intructions. If you're getting failures, it'd be good to find in your code the reason for them and see if it won't give you trouble with other mods to remove them.
yeah. I tried to follow the instructions manually, but there are two files? Which one do I use? One says 109 and the other says 108-9 or something like that. Both had install instructions and were packaged in the 1.05 compatible version
The 1.09 one.
i am using smf1.0.5 and want to install faster parsecode mod. can i install 1.09 directly or do i have to install the other updates first?
thanks
Quote from: umanga on August 22, 2005, 09:28:06 AM
i am using smf1.0.5 and want to install faster parsecode mod. can i install 1.09 directly or do i have to install the other updates first?
thanks
Just that one.
thanks a lot :)
one more thing..!!
do i have to unistall all my other mods and then reinstall them or have i misunderstood some of the other posts?!
Depends on what the other mods are.
Modification Packages
Mod Name Version
1. OnLine Users Today 1.3 [ Uninstall ] [ List Files ] [ Delete ]
2. Streaming_4.1 4.1 [ Uninstall ] [ List Files ] [ Delete ]
3. Spoiler Tag 1.04 [ Apply Mod ] [ List Files ] [ Delete ]
4. Faster Parsecode 1.09 [ Uninstall ] [ List Files ] [ Delete ]
5. Spam-me-not 1.0.1 [ List Files ] [ Delete ]
6. "New Topic/Poll" buttons in Display.template.php 1.1 [ Uninstall ] [ List Files ] [ Delete ]
7. Ultimate Shoutbox 1.31 [ Uninstall ] [ List Files ] [ Delete ]
8. Simple ImageShack 1.0.2 [ Apply Mod ] [ List Files ] [ Delete ]
9. SMF 1.0.5 Update Package 1.0.5 [ List Files ] [ Delete ]
10. Lots_o_Smileys 1.0 [ Apply Mod ] [ List Files ] [ Delete ]
11. G&S_Sticky 1.1 [ Uninstall ] [ List Files ] [ Delete ]
12. Board Default Sort 1.25 [ List Files ] [ Delete ]
13. SSI NewsArchive 1.3 [ Uninstall ] [ List Files ] [ Delete ]
14. SMF 1.0.4 Update Package 1.0.4 [ List Files ] [ Delete ]
15. Location Mod 1.1.2 [ List Files ] [ Delete ]
16. Group Moderators 1.0c [ Uninstall ] [ List Files ] [ Delete ]
17. Integrated Chat 2.3 [ Uninstall ] [ List Files ] [ Delete ]
18. SMF Arcade 1.2.1 [ Apply Mod ] [ List Files ] [ Delete ]
19. Message Icon Manager (Quick Reply) 1.2 [ Uninstall ] [ List Files ] [ Delete ]
20. PHP 4.4.0 Compatibility Update 1.0 [ List Files ] [ Delete ]
21. VisualWarning 1.26 [ Uninstall ] [ List Files ] [ Delete ]
I upgraded from 1.0.3. to 1.0.5. and before the upgrade removed all Faster Parsecode and all related mods. When I tried to install 1.09, it didn't work--it had a failure in subs. Is it just a bad package or something else? As soon as I saw that, I left it as is and didn't hit proceed. It doesn't install until I hit proceed, right?
-Shayna
umanga, I don't see a parsecode related mod other than the spoiler tag one, which is fine if it's the last version of it.
stargazer_1017, you have SMF 1.0.5 and are trying to install Faster Parsecode 1.09? As long as you don't hit proceed, it won't try to install. What other mods have you installed? There's probably one that already modified that code and that's why the the install fails.
These are the mods I had installed:
Mod Name Version
1. The Bar Of Experience 1.2 [ Uninstall ]
2. Location Mod 1.1.1 [ Uninstall ]
3. Location Mod - Additional Maps 1.1.1 [ Uninstall ]
4. Location Mod - Who Flags 1.1.1 [ Uninstall ]
5. OnLine Users Today 1.2 [ Uninstall ]
6. Ultimate Shoutbox 1.22 [ Uninstall ]
7. SMFShop 1.1 [ Uninstall ]
8. Karma Log 1.0 [ Uninstall ]
9. Googlebot & Spiders Mod 1.0.1 [ Uninstall ]
10. G&S_Sticky 1.1 [ Uninstall ]
11. SMF 1.0.4 Update Package 1.0.4 [ Uninstall ]
12. SMF 1.0.5 Update Package 1.0.5 [ Uninstall ]
13. PHP 4.4.0 Compatibility Update 1.0 [ Uninstall ]
As I mentioned, I uninstalled Faster Parsecode and all of the related mods in order to upgrade, and then when I tried to reinstall it, it wouldn't let me. I don't know which of the ones above would've modified to code, except for the upgrade ones.
-Shayna
Hmm... I don't see any other that could modify that function either except the upgrade ones, and this mod would install fine since it's for version 1.0.5. Could you open the file Subs.php in the Sources directory and copy the parsecode function and paste it here inside code tags?
Cheers Anguz :)
Quote from: Anguz on August 23, 2005, 11:47:51 PM
Hmm... I don't see any other that could modify that function either except the upgrade ones, and this mod would install fine since it's for version 1.0.5. Could you open the file Subs.php in the Sources directory and copy the parsecode function and paste it here inside code tags?
Sorry to be a nuisance, but I don't know which I should post exactly. I searched for "parsecode" and there are a lot of functions. I found this one:
// Parse code.....
parsecode($php_parts[$php_i]);
What that the right one?
-Shayna
No, look for the block that starts with
function parsecode(&$message)
{
until where the next function begins.
Okay, I found that one:
function parsecode(&$message)
{
global $modSettings, $scripturl, $txt, $settings, $context;
static $codefromcache = array(), $codetocache = array();
// If it wasn't already set, set it.
if (empty($codefromcache))
{
// If any tags are disabled then we won't add them.
if (!empty($modSettings['disabledBBC']))
{
$disabled = array_flip(explode(',', $modSettings['disabledBBC']));
foreach ($disabled as $tag => $dummy)
$disabled[trim($tag)] = true;
}
-Shayna
It's that one, but it's incomplete. Could you look for it again until the next function that starts like this
// Parse smileys in the passed message.
function parsesmileys(&$message)
Whoops! Sorry about that, Anguz. Here it is:
function parsecode(&$message)
{
global $modSettings, $scripturl, $txt, $settings, $context;
static $codefromcache = array(), $codetocache = array();
// If it wasn't already set, set it.
if (empty($codefromcache))
{
// If any tags are disabled then we won't add them.
if (!empty($modSettings['disabledBBC']))
{
$disabled = array_flip(explode(',', $modSettings['disabledBBC']));
foreach ($disabled as $tag => $dummy)
$disabled[trim($tag)] = true;
}
$code_to_from = array(
// A named email address. [[email protected]]me[/email] And, you can't have []s in your email, I should know.
'~\[email=(.+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '"$2 ($1)"' : '"<a href=\"mailto:" . strtr("$1", array("\"" => """, "]" => "", "[" => "")) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
// An image. Width and height can be are optional.
'~\[img(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*(.+?)(?:<br />)*\[/img\]~ie' => isset($disabled['img']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "@")))' : '"<img src=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "@", "\"" => """))) . "\" alt=\"\"" . ("$2" != "" ? " width=\"$2\"" : "") . ("$4" != "" ? " height=\"$4\"" : "") . " border=\"0\" />"',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=(.+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"' : 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
'~\[iurl\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">$1</a>"' : '"$1"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\">$1</a>"',
// FTP link. Named...? [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$1")' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array("@" => "@"))) . "</a>"',
'~\[ftp=(.+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^:\]]+?)\]([^\]]*?\[url(?:=[^\]]+?)?\].+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace("~(\[url.*?\]|\[/url\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
'~\[url=(.+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '"$2 ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . strtr("$2", array("@" => "@")) . "</a>"',
'~\[url\](?:<br />)*(.+?)(?:<br />)*\[/url\]~ie' => isset($disabled['url']) ? '"$1"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">$1</a>"',
// Bold, italics, underline, strikeout.
'~\[b\](.+?)\[/b\]~i' => isset($disabled['b']) ? '$1' : '<b>$1</b>',
'~\[i\](.+?)\[/i\]~i' => isset($disabled['i']) ? '$1' : '<i>$1</i>',
'~\[u\](.+?)\[/u\]~i' => isset($disabled['u']) ? '$1' : '<span style="text-decoration: underline;">$1</span>',
'~\[s\](.+?)\[/s\]~i' => isset($disabled['s']) ? '$1' : '<del>$1</del>',
// A quote. May or may not specify an author and/or link and date.
'~\[quote(?: author)?="(.{1,80}?)"\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',
'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~ei' => isset($disabled['quote']) ? '\'<div>\'' : '\'<div class="quoteheader"><a href="' . $scripturl . '?$2">' . $txt['smf239'] . ': $1 ' . $txt[176] . ' \' . timeformat(\'$3\') . \'</a></div><div class="quote">\'',
'~\[quote author=(.{1,80}?)\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',
'~\[quote\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf240'] . '</div><div class="quote">',
'~\[/quote\](?:<br />)?~i' => isset($disabled['quote']) ? '</div>' : '</div>',
// Size the font. [size=large]HELLO![/size]
'~\[size=([\d]{1,2}p[xt]|(?:x-)?small(?:er)?|(?:x-)?large[r]?)\](.+?)\[/size\]~i' => isset($disabled['size']) ? '$2' : '<span style="font-size: $1;">$2</span>',
'~\[size=([\d])\](.+?)\[/size\]~i' => isset($disabled['size']) ? '$2' : '<font size="$1">$2</font>',
// Performat/justify text. [center]Justifying is good.[/center]
'~\[pre\](.+?)\[/pre\]~i' => isset($disabled['pre']) ? '$1' : '<pre>$1</pre>',
'~\[left\](.+?)\[/left\]~i' => isset($disabled['left']) ? '$1' : '<div align="left">$1</div>',
'~\[right\](.+?)\[/right\]~i' => isset($disabled['right']) ? '$1' : '<div align="right">$1</div>',
'~\[center\](.+?)\[/center\]~i' => isset($disabled['center']) ? '$1' : '<div align="center">$1</div>',
// Teletyped text. Monospace, in other words.
'~\[tt\](.+?)\[/tt\]~i' => isset($disabled['tt']) ? '$1' : '<tt>$1</tt>',
// Subscript and superscript. 6[sup]2[/sup] = 36.
'~\[sub\](.+?)\[/sub\]~i' => isset($disabled['sub']) ? '$1' : '<sub>$1</sub>',
'~\[sup\](.+?)\[/sup\]~i' => isset($disabled['sup']) ? '$1' : '<sup>$1</sup>',
// An email address. [email][email protected][/email]
'~\[email\](?:<br />)*(.+?)(?:<br />)*\[/email\]~ie' => isset($disabled['email']) ? '"$1"' : '"<a href=\"mailto:" . strtr("$1", array(":" => ":", "\"" => """, "[" => "", "]" => "")) . "\">$1</a>"',
// Specify a specific font. [font=Comic Sans]Blah![/font]
'~\[font=([\w,\-\s]+?)\](.+?)\[/font\]~i' => isset($disabled['font']) ? '$2' : '<span style="font-family: $1;">$2</span>',
// Colors.... [red]See?[/red]
'~\[color=(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[\w]{1,12})\](.*?)\[/color\]~i' => isset($disabled['color']) ? '$2' : '<span style="color: $1;">$2</span>',
'~\[(black|white|red|green|blue)\](.+?)\[/\1\]~i' => isset($disabled['color']) ? '$2' : '<span style="color: $1;">$2</span>',
'~\[(chr|k)issy\](.+?)\[/\1issy\]~i' => isset($disabled['color']) ? '$2' : '<span style="color: #CC0099;">$2 :-*</span>',
// Lists... [list][*]First, ...[o]Second![li]THIRD!!![/li][/list]
'~\[list\](?:<br />)?~i' => isset($disabled['list']) || isset($disabled['li']) ? '' : '<ul style="margin-top: 0; margin-bottom: 0;">',
'~\[/list\](?:<br />)?~i' => isset($disabled['list']) || isset($disabled['li']) ? '' : '</ul>',
'~(?:<br />| |\s)*\[li\](.+?)\[/li\](?:<br />| |\s)*~i' => isset($disabled['list']) || isset($disabled['li']) ? '<br />$1<br />' : '<li>$1</li>',
// Horizontal rule. [hr] => ------------------.
'~\[hr(?:\s*/)?\]~i' => isset($disabled['hr']) ? '' : '<hr />',
// A break. [br] or [br /]. (it makes no sense to disable this one :P.)
'~\[br(?:\s*/)?\]~i' => '<br />',
// Right-to-left and left-to-right strings.
'~\[(ltr|rtl)\](.+?)\[/\1\]~i' => isset($disabled['ltr']) || isset($disabled['rtl']) ? '$2' : '<div dir="$1">$2</div>',
// Acronyms and abbreviations... [acronym=Bulletin Board Code]BBC[/acronym]
'~\[abbr=((?:")?)(.+?)\\1\](.+?)\[/abbr\]~ie' => isset($disabled['abbr']) ? '"$3 ($2)"' : '"<abbr title=\"" . strtr("$2", array("\"" => """)) . "\">$3</abbr>"',
'~\[acronym=((?:")?)(.+?)\\1\](.+?)\[/acronym\]~ie' => isset($disabled['acronym']) ? '"$3 ($2)"' : '"<acronym title=\"" . strtr("$2", array("\"" => """)) . "\">$3</acronym>"',
// [me=Comment]does something[/me]
'~\[me=((?:")?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => isset($disabled['ftp']) ? '/me $3<br />' : '<div class="meaction">* $2 $3</div>',
// An email address they just typed in. Don't match if there's already a mailto: or = before it.
'~(?<=[\?\s\xA0[\]()*\\\;>]|^)([\w\-\.]{1,80}@[\w\-]+\.[\w\-\.]+[\w\-])(?=[?,\s\xA0\[\]()*\\\]|$|<br />| |>|<|"|'|\.(?:\.| |\s|$|<br />))~i' => '<a href="mailto:$1">$1</a>',
'~(?<=<br />)([\w\-\.]{1,80}@[\w\-]+\.[\w\-\.]+[\w\-])(?=[?\.,\s\xA0\[\]()*\\\]|$|<br />| |>|<|"|')~i' => '<a href="mailto:$1">$1</a>',
// This last one fixes spaces at the beginning of lines.
'~<br /> ~' => '<br /> ',
// Match a table... hopefully with everything in the right place.
'~\[table\](?:\s|\xA0|<br />| )*((?:\[tr\](?:\s|\xA0|<br />| )*\[td\]).*?(?:(?:\s|\xA0|<br />| )*\[/td\]\[/tr\])*)(?:\s|\xA0|<br />| )*\[/table\](?:\s|\xA0|<br />| )?~i' => '<table>$1</table>',
);
$codefromcache = array_keys($code_to_from);
$codetocache = array_values($code_to_from);
// GLOWING or /shadowed/ text.
$codefromcache[] = '~\[glow=([#\w]{3,12}),([012]\d{1,2}|\d{1,2})(,[^]]+)?\](.+?)\[/glow\]~i';
$codetocache[] = isset($disabled['glow']) ? '$4' : '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">$4</td></tr></table> ';
$codefromcache[] = '~\[shadow=([#\w]{3,12}),(left|right|top|bottom|[0123]\d{0,2})\](.+?)\[/shadow\]~ei';
$codetocache[] = isset($disabled['shadow']) ? 'strtr(\'$3\', array(\'\\"\' => \'"\'))' : '\'<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Shadow(color=$1, direction=\' . (isset($shadow_directions[\'$2\']) ? $shadow_directions[\'$2\'] : (int) \'$2\') . \'); font: inherit;">\' . strtr(\'$3\', array(\'\\"\' => \'"\')) . \'</td></tr></table> \'';
// Moving text... [move]stuff[/move]
$codefromcache[] = '~\[move\](.+?)\[/move\]~i';
$codetocache[] = isset($disabled['move']) ? '$1' : '<marquee>$1</marquee>';
// Handle flash.
$codefromcache[] = '~\[flash=(\d+),(\d+)\](?:<br />)*([^<>]+?)(?:<br />)*\[/flash\]~ie';
if (empty($modSettings['enableEmbeddedFlash']) || isset($disabled['flash']))
$codetocache[] = isset($disabled['url']) ? '"$3"' : '"<a href=\"" . strtr("$3", array("\"" => """)) . "\" target=\"_blank\">$3</a>"';
// Internet Explorer for Windows.
elseif ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
$codetocache[] = '"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"$1\" height=\"$2\"><param name=\"movie\" value=\"" . strtr("$3", array("\"" => """)) . "\" /><param name=\"play\" value=\"true\" /><param name=\"loop\" value=\"true\" /><param name=\"quality\" value=\"high\" /><param name=\"AllowScriptAccess\" value=\"never\" /><embed src=\"" . strtr("$3", array("\"" => """)) . "\" width=\"$1\" height=\"$2\" play=\"true\" loop=\"true\" quality=\"high\" AllowScriptAccess=\"never\" /><noembed><a href=\"" . strtr("$3", array("\"" => """)) . "\" target=\"_blank\">$3</a></noembed></object>"';
// Anything else.
else
$codetocache[] = '"<embed type=\"application/x-shockwave-flash\" src=\"" . strtr("$3", array("\"" => """)) . "\" width=\"$1\" height=\"$2\" play=\"true\" loop=\"true\" quality=\"high\" AllowScriptAccess=\"never\" /><noembed><a href=\"" . strtr("$3", array("\"" => """)) . "\" target=\"_blank\">$3</a></noembed>"';
}
// Nothing to parse... ?
if (!strstr($message, '[') && !strstr($message, '://') && !strstr($message, '@') && !strstr($message, '/me') && !strstr($message, '<'))
return;
$message = strtr($message, array('$' => '$'));
// Replace <a href="something">somewhere</a> with HTML.
if (!empty($modSettings['enablePostHTML']) && strstr($message, '<'))
{
$message = preg_replace('~<a\s+href=(?:")?(?:\[url\])?((?:http://|ftp:/\|https://|ftps://|mailto:).+?)(?:\[/url\])?(?:")?>(.+?)</a>~ie', '\'<a href="$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \'</a>\'', $message);
// Do <img ... /> - with security... action= -> action-.
preg_match_all('~<img\s+src=(?:")?(?:\[url\])?((?:http://|ftp://|https://|ftps://).+?)(?:\[/url\])?(?:")?(?:\s+alt=(?:")?(.*?)(?:")?)?(?:\s?/)?>~i', $message, $matches, PREG_PATTERN_ORDER);
if (!empty($matches[0]))
{
$replaces = array();
foreach ($matches[1] as $match => $imgtag)
{
// No alt?
if (!isset($matches[2][$match]))
$matches[2][$match] = '';
// Remove action= from the URL - no funny business, now.
if ($imgtag != preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag))
$replaces[$matches[0][$match]] = '<img src="' . preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag) . '" alt="' . $matches[2][$match] . '" border="0" />';
// Check if the image is larger than allowed.
if (!empty($modSettings['maxwidth']) && !empty($modSettings['maxheight']))
{
list ($width, $height) = url_image_size($imgtag);
if ($width > $modSettings['maxwidth'] || $height > $modSettings['maxheight'])
{
if ($width > $modSettings['maxwidth'] && !empty($modSettings['maxwidth']))
{
$height = floor($modSettings['maxwidth'] / $width * $height);
$width = $modSettings['maxwidth'];
if ($height > $modSettings['maxheight'] && !empty($modSettings['maxheight']))
{
$width = floor($modSettings['maxheight'] / $height * $width);
$height = $modSettings['maxheight'];
}
}
else
{
if ($height > $modSettings['maxheight'] && !empty($modSettings['maxheight']))
{
$width = floor($modSettings['maxheight'] / $height * $width);
$height = $modSettings['maxheight'];
}
}
}
// Set the new image tag.
$replaces[$matches[0][$match]] = '<img src="' . preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag) . '" width="' . $width . '" height="' . $height . '" alt="' . $matches[2][$match] . '" border="0" />';
}
elseif (strpos($matches[0][$match], '[url]') !== false || substr($matches[0][$match], 0, 4) == '<')
$replaces[$matches[0][$match]] = '<img src="' . preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag) . '" alt="' . $matches[2][$match] . '" border="0" />';
}
$message = strtr($message, $replaces);
}
}
// Do the code if necessary.
if (strstr($message, '[') || strstr($message, '://') || strstr($message, '@') || strstr($message, '/me'))
{
$shadow_directions = array('left' => '270', 'right' => '90', 'top' => '0', 'bottom' => '180');
$message = preg_replace($codefromcache, $codetocache, $message);
// Tables need to be done twice or they won't work properly.
if (strpos($message, '<table>') !== false)
{
for ($i = 0; $i < 2; $i++)
$message = preg_replace(
array(
'~((?:<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />| )*(?:<tr>|\[tr\])|</td>|\[/td\])(?:\s|\xA0|<br />| )*\[td\](?:\s|\xA0|<br />| )*(.*?)(?:\s|\xA0|<br />| )*\[/td\](?:\s|\xA0|<br />| )*((?:</tr>|\[/tr\])(?:\s|\xA0|<br />| )*(?:<tr>|\[tr\]|</table>)|<td(?: valign="top")?>|\[td\])~i',
'~(<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />| )*\[tr\](?:\s|\xA0|<br />| )*(.*?)(?:\s|\xA0|<br />| )*\[/tr\](?:\s|\xA0|<br />| )*(</table>|<tr>|\[tr\])~i'
),
array(
'$1<td valign="top">$2</td>$3',
'$1<tr>$2</tr>$3'
), $message
);
}
}
// Enable Basic HTML?
if (!empty($modSettings['enablePostHTML']) && strstr($message, '<'))
{
// b, u, i, s, pre... basic tags.
$closable_tags = array('b', 'u', 'i', 's', 'pre', 'blockquote');
foreach ($closable_tags as $tag)
{
$opens = substr_count($message, '<' . $tag . '>');
$closes = substr_count($message, '</' . $tag . '>');
$message = str_replace(array('<' . $tag . '>', '</' . $tag . '>'), array('<' . $tag . '>', '</' . $tag . '>'), $message);
if ($closes < $opens)
$message .= str_repeat('</' . $tag . '>', $opens - $closes);
}
// <br /> should be empty.
$empty_tags = array('br');
foreach ($empty_tags as $tag)
$message = str_replace(array('<' . $tag . '>', '<' . $tag . '/>', '<' . $tag . ' />'), '<' . $tag . ' />', $message);
}
}
-Shayna
OK, you seem to be missing a line, that's why the mod doesn't install. Find
$message = strtr($message, array('$' => '$'));
and replace with
$message = strtr($message, array('$' => '$'));
and save. Now try installing the mod.
Thanks Anguz! That worked like a charm!
-Shayna
:)
There is a new parse engine in 1.1
Quote from: groundup on August 31, 2005, 06:39:33 AM
There is a new parse engine in 1.1
Oh, I know that. Thanks.
Install Actions
Installations actions for "Faster Parsecode":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
I downloaded the FasterParsecode108_SMF103.tar.gz and my version is 1.0.3 beta 3, my template is the classic... help?
Hmm... beta 3? Do you mean 1.1 then? This mod is not for that verison.
yeah, sorry, that was what I meant.
Does that mean I can't get the [hide] and [spoiler] mod!? :'(
Quote from: Snickers on September 17, 2005, 06:53:14 PM
yeah, sorry, that was what I meant.
Does that mean I can't get the [hide] and [spoiler] mod!? :'(
Not yet, at least not from me. I'm gonna wait until 1.1 reaches final before upgrading any of my mods to it. BTW, I didn't do a hide tag mod that I remember.
I know, but someone has, and it requires faster parsecode to work :'(
crap crap crap :'( :'( :'(
Faster Parsecode is not compitable with SMF 1.1 RC1, right ? Is itn't required anymore?
Pity :( ...some of mods (such as EscapeTag) needs Faster Parsercode have to get newer version.
the 11rc parse engine is far superior to the faster parsecode one, doesn't really make all that much sense to keep using this now... and there are spoiler and hide tag mods iirc. (not sure about the latter, though)
huijaa, there's a new tag in 1.1 to escape bbcode parsing. I think it was nobbc. Let me see:
[nobbc][b]hello[/b][/nobbc]
[b]hello[/b]
when i try to install the parse mod i get this error
The package you tried to upload either is not a valid package or has become corrupted.
im running smf 1.0.5 and i downloaded the newest one... what the problem?
I don't know. Could you attach it here so I take a look at the file you have? Or just download it again, maybe something went wrong when you downloaded it the first time.
i dowloaded again... uploaded that tar.gz file but still got an error
Okay. Could you attach it here so I take a look at the file you have?
http://mods.simplemachines.org/index.php?a=download;mod=39;id=8072
this is the one i have.
I know that's the one you downloaded, but the thing is that so have hundreds of others that didn't have that problem you do. That's why I'm asking for the file in your machine, so I can see if it's getting corrupt when you download it.
http://www.windborn.fh-net.com/underground/script/FasterParsecode109_SMF105.tar.gz
this is the script i have
WinRAR says the file is corrupt.
so what to do now?
What are you downloading it with? Maybe try downloading it with something else?
I'm getting the same error message. Fresh download from the mod site. WinRAR says the file is corrupt. Me thinks the file truely is corrupt.
SMF gives the following error:
The package you tried to upload either is not a valid package or has become corrupted.
There is no problem at all if you use wirar v3.50 or v3.51 - i just have tested all archives and there was no error.
Actually I think it's a firefox thing. If I download with IE it's fine - for the most part - still get errors on install though.
But when I download it with Firefox it says the file is corrupt.
Is it possible that this Mod is breaking the parsing of CAPITALIZED closing quote tags?
For example, I've imported a vB forum, where much of the BB Code is capitalized, among them the quote tag. I've notice that in any of the old, imported posts where there is a quote, the quote extends to the end of the post, even though there is a closing /QUOTE tag. When I change that closing tag to /quote, the post parses as it should.
EDIT: It's definitely this MOD. I tested before/after scenarios on a clean SMF 1.0.5 install.
Hmm... I thought I had already fixed the issue with caps long ago. Thanks for noticing this, I'll take a look at it and provide an update hopefully soon.
hello, wouldn't it be much easier to work with utf-8... what we have to do, to do so ???
What do you mean?
sorry, I slided into your thread... this question belongs to a lang-mod...
Just to be clear. I should NOT install this on 1.1RC1 right?
Yup, don't. It won't anyway.
not working!
says package is corrupt! ::)
Try downloading it with another program, it may be a problem in your download.
i tried doing it thru the package manager
then tried downloading it from this site
either way, it said the package was corrupt
and i had no other mods installed for any clash or something
it was a fresh 1.1 rc1 install
Ah, that's why, then. This mod is not for 1.1.
Quote from: Anguz on December 02, 2005, 12:35:31 PM
Ah, that's why, then. This mod is not for 1.1.
oh okay
wont an update be released then?
Ok I am a dumb person. How does this stuff work. I get an zipped file to my desktop then what? Do I need all the previous versions of faster parsecode? Do I unzip then upload to the package manager?
Just the version of the mod that's for your version of SMF. Upload to Package Manager and install.
Every time some software was "open source" the same problem occur :
Most recent version does not include hack or mod that could comply with it ...
It's such a shame ... but nothing could help it so , better keep on searching solution and not spend too much time complaining about.
( I experienced the same with the new version of joomla and a hack that depend on the version... and now woth SMF 1.1RC2 and faster parsecode ... )
Should it be a way to have an "all version compatible" Faster parsecode or directly include it into the sources of SMF as an optional component ( by optional i mean that if you doesn't need it you could disable it. )
more and more people are using faster parsecode. so why not add it like an improvement to the source and not only a simple mod ?
1.1 has a totally different bbc parser to 1.0x.
do i need this mod for my forum running smf version 1.1 rc2 ?
No, SMF is perfectly capable of parsing bb code without this mod. :)
I did a test install of SMF 1.06 in my PC today and Faster Parsecode for 1.05 doesn't install.
My main concern is Table from CSV but Faster Parsecode must be installed first.
I understand this must be a headneck for you Anguz :(
I had to un-install Faster Parsecode 1.0.9 for my now 1.0.6 forum. Any fixes for 1.0.6. I do notice a performance difference without it.
I just checked and there's a small difference in 9 lines of the original parsecode function between 1.0.5 and 1.0.6, which I have to change in the mod file when searching and also in the faster parsecode function.
I'll have it done tomorrow, packaged and uploaded in the mod site. Sorry I can't finish it right now. As usual, I'll post a reply here when the update is up.
Thank you Anguz :) I hope you will also have a look at Table from CSV to see if something is needed there too.
1.10
- Updated for SMF 1.0.6.
agridoc, Table From CSV should install fine after Faster Parsecode. If you have any trouble, let me know in its topic.
I actually packaged the update last night, but had some trouble uploading the file. It's there now.
FasterParsecode1-10_SMF1-0-6.zip (http://mods.simplemachines.org/index.php?a=download;mod=39;id=13217)
I just tried it on one my test forum and got a failure. :( The other worked o.k.
Is your test forum a clean 1.0.6 or an update from a previous version, or does it have another mod installed already?
Quote from: Anguz on January 31, 2006, 02:34:01 PM
Is your test forum a clean 1.0.6 or an update from a previous version, or does it have another mod installed already?
I was previously on 1.0.5 and applied the 1.0.6 update this past weekend.
Edit - no other mod other than the 1.0.6 patch.
I tried Faster Parsecode for SMF 1.06 in a fresh 1.06. No problems with install, forum seems to work OK.
Unfortunatately Table From CSV for 1.05 couldn't be installed after that
Just posted the update for Table From CSV, agridoc, let me know how it goes.
Quote from: RoarinRow on January 31, 2006, 02:37:11 PM
Quote from: Anguz on January 31, 2006, 02:34:01 PM
Is your test forum a clean 1.0.6 or an update from a previous version, or does it have another mod installed already?
I was previously on 1.0.5 and applied the 1.0.6 update this past weekend.
Edit - no other mod other than the 1.0.6 patch.
I resolved the issue myself. Just took my original subs.php file from my working site and copied over to my test site, then ran the install again.
Good. :)
Quote from: Anguz on January 31, 2006, 01:03:10 PM
1.10
- Updated for SMF 1.0.6.
agridoc, Table From CSV should install fine after Faster Parsecode. If you have any trouble, let me know in its topic.
I actually packaged the update last night, but had some trouble uploading the file. It's there now.
FasterParsecode1-10_SMF1-0-6.zip (http://mods.simplemachines.org/index.php?a=download;mod=39;id=13217)
Thanks very much. I can see already this has made a bit of a difference. Cool beans! ;D ;)
It really does Skipdawg.
Anguz, have you noticed the topic Wrong parsing of UTF characters in board names categories and posts in 1.1 RC2 (http://www.simplemachines.org/community/index.php?topic=63235.0)?
Altough I would like to follow a more simplified approach for multilingual (Multilingual in SMF 1.1RC2 without UTF for Greek and other languages? (http://www.simplemachines.org/community/index.php?topic=64142.0)) I think it' s an interesting programming challenge to do a Faster Parsecode Mod for 1.1 RC2 without these UTF problems. ;)
Heh, thanks for the challenge.
I really don't know what to do with this mod for 1.1 yet, though. I don't really feel like re-writting the whole thing, so if actually did release it, it'd probably be the same code. I still am not sure what disadvantages it'd pose compared to the new function, really.
I'll look into the UTF thing, which I'm not familiar with, and see if I can think of something.
Thanks, Skipdawg, I'm glad you like it. :)
I believe you will come with a surprise Anguz 8)
I had to manually add this and the spoiler tag on one of the forums (post-upgrade). I got a failure in Subs.php on the Faster Parse code, so I just modded everything myself.
Everything works nicely when you do it yourself, but I think there might be a mistake in the coding of the mod. I might be wrong. As for the spoiler tag, we just need to change the 1.0.5 to 1.0.6 for it to work.
I'm afraid of even trying this on my other forum, because I have so many mods, and I don't wanna make everything go poof.
Hmm... I wonder if the function's code is different in a clean install compared to an upgrade or update. I'll check.
Regarding things going poof, if you don't have any mods that modified the parsecode function, then it's as safe as installing it in an unmodified forum.
Well, I updated a 1.0.5 install to 1.0.6 and then installed Faster Parsecode v1.10 and it went fine. Dunno what the problem is. If you have a failure when trying to install the mod to your other forum, could you please copy your parsecode function in Subs.php and paste it here between code tags so I see what the problem could be? If you know that you don't have another mod that changed that code, that is. What other mods did you have installed in the forum you modified by hand?
Anguz, this works ok with 1.0.7? Hopefully, it does. Lemme know.
Hello, I have tried all versions of this mod,
but I can't install any package, it says that it needs some installation actions?
I use SMF 1.1 RC2 with the security update from March
Many thanks in advance!
GJ-tje there is no yet version for 1.1. Anguz waits for the final release. This is also the only reason I haven't upgraded to 1.1. RC2.
Quote from: agridoc on April 15, 2006, 01:30:53 PM
GJ-tje there is no yet version for 1.1. Anguz waits for the final release. This is also the only reason I haven't upgraded to 1.1. RC2.
Do you know when a 1.1RC2 compatible version is comming up? :D Or do we really have to wait untill 1.1 is being released?
1.1 RC2 is a release candidate, 1.1 final must be released first, then it's up to Anguz.
I don' t think that 1.1 final is far away.
Quote from: agridoc on April 15, 2006, 01:42:16 PM
1.1 RC2 is a release candidate, 1.1 final must be released first, then it's up to Anguz.
I don' t think that 1.1 final is far away.
To bad... :( But I can wait! :D (And I can't wait untill the day that 1.1 final comes out! :P)
Which Faster Parsecode must i download for SMF RC 2 ?
I know we need to edit it or something right ? Couldn't find that post.
Wanted to have a spoiler tag for my board : http://www.simplemachines.org/community/index.php?topic=19831.0
Hope to hear from you guys soon. Thanks in advance :)
Quote from: kokorobox on April 17, 2006, 05:37:07 AM
Which Faster Parsecode must i download for SMF RC 2 ?
I know we need to edit it or something right ? Couldn't find that post.
Wanted to have a spoiler tag for my board : http://www.simplemachines.org/community/index.php?topic=19831.0
Hope to hear from you guys soon. Thanks in advance :)
There isn't version for 1.1 RC2 cause this is beta.
Quote from: ivo2296 on April 17, 2006, 09:38:42 AM
Quote from: kokorobox on April 17, 2006, 05:37:07 AM
Which Faster Parsecode must i download for SMF RC 2 ?
I know we need to edit it or something right ? Couldn't find that post.
Wanted to have a spoiler tag for my board : http://www.simplemachines.org/community/index.php?topic=19831.0
Hope to hear from you guys soon. Thanks in advance :)
There isn't version for 1.1 RC2 cause this is beta.
And there won't be a version coming out too... The author of the mod, is waiting for SMF 1.1 final...
Then i will have to wait till 1.1 Final is out or ?
Quote from: kokorobox on April 18, 2006, 03:14:13 AM
Then i will have to wait till 1.1 Final is out or ?
Yep, we all have to wait... :(
I tot there is some part in the threads said we could hack the thing so its usable in 1.1 RC 2 ?
Hi
I have just tried to install this mod on a clean fresh install of 1.1 RC2 but get the following errors.
Installing this package will perform the following actions: Type Action Description
1. Execute Modification ./Sources/Subs.php Test failed
I have the following mods installed on my forum
*1. Faster Parsecode 1.10 [ Apply Mod ] [ List Files ] [ Delete ]
2. TinyPortal 0.86 [ Uninstall ] [ List Files ] [ Delete ]
3. Merge Double Posts 1.05 [ Uninstall ] [ List Files ] [ Delete ]
4. VisualWarning 1.3 [ Uninstall ] [ List Files ] [ Delete ]
*5. No Changing Moderator's Edit 0.3 [ Apply Mod ] [ List Files ] [ Delete ]
6. Member Color Link 1.87 [ Uninstall ] [ List Files ] [ Delete ]
7. Group Moderators 1.3d [ Uninstall ] [ List Files ] [ Delete ]
*8. Create Topic on Report to Moderator 0.2 [ Apply Mod ] [ List Files ] [ Delete ]
9. Custom Profile Field Mod 3.01 [ Uninstall ] [ List Files ] [ Delete ]
10. Hide Board 1.0 [ Uninstall ] [ List Files ] [ Delete ]
11. Redirection Boards 2.0 [ Uninstall ] [ List Files ] [ Delete ]
12. SMF 1.0.7 / 1.1 RC2 Update 1.0 [ Uninstall ] [ List Files ] [ Delete ]
some of these mods are not installed, ones marked with *
Please could you have a look at this for me
Thanks
Geraint
Quote from: geraintw1uk on May 07, 2006, 07:03:18 PM
Hi
I have just tried to install this mod on a clean fresh install of 1.1 RC2 but get the following errors.
Installing this package will perform the following actions: Type Action Description
1. Execute Modification ./Sources/Subs.php Test failed
I have the following mods installed on my forum
*1. Faster Parsecode 1.10 [ Apply Mod ] [ List Files ] [ Delete ]
2. TinyPortal 0.86 [ Uninstall ] [ List Files ] [ Delete ]
3. Merge Double Posts 1.05 [ Uninstall ] [ List Files ] [ Delete ]
4. VisualWarning 1.3 [ Uninstall ] [ List Files ] [ Delete ]
*5. No Changing Moderator's Edit 0.3 [ Apply Mod ] [ List Files ] [ Delete ]
6. Member Color Link 1.87 [ Uninstall ] [ List Files ] [ Delete ]
7. Group Moderators 1.3d [ Uninstall ] [ List Files ] [ Delete ]
*8. Create Topic on Report to Moderator 0.2 [ Apply Mod ] [ List Files ] [ Delete ]
9. Custom Profile Field Mod 3.01 [ Uninstall ] [ List Files ] [ Delete ]
10. Hide Board 1.0 [ Uninstall ] [ List Files ] [ Delete ]
11. Redirection Boards 2.0 [ Uninstall ] [ List Files ] [ Delete ]
12. SMF 1.0.7 / 1.1 RC2 Update 1.0 [ Uninstall ] [ List Files ] [ Delete ]
some of these mods are not installed, ones marked with *
Please could you have a look at this for me
Thanks
Geraint
If you read the topic, before you posted, you would allready know that this mod isn't supported in SMF 1.1RC2. The creator of this mod waits until SMF 1.1 goes final... :D
Quote from: Vinspire^ on April 18, 2006, 06:56:28 AM
I tot there is some part in the threads said we could hack the thing so its usable in 1.1 RC 2 ?
IIRC, there was a reply to this topic where I said how you could use this mod in 1.1 RC2, but there's not a package for it, you'd have to edit it by hand. HIH.
Quote from: Anguz on May 10, 2006, 02:28:08 AM
Quote from: Vinspire^ on April 18, 2006, 06:56:28 AM
I tot there is some part in the threads said we could hack the thing so its usable in 1.1 RC 2 ?
IIRC, there was a reply to this topic where I said how you could use this mod in 1.1 RC2, but there's not a package for it, you'd have to edit it by hand. HIH.
So, this means you are not gonna make a version which is compatible wif 1.1 RC 2 ? :( :( :(
I think you should as a lot of ppls would appreciate it ....
I don't know if I will at all. At worst, I'll just package the code I have for this mod now and make an installer for 1.1, at best, I'll re-write the whole code trying to make it even faster. The problem I have is that this took me quite a bit of time the first time and it looks like that much more to do it better, and I don't have time for this lately. That's why I'm also waiting for 1.1 Final, because so many things change between each pre-final version, that updating is pretty time-consuming. I hope you understand my reason.
Quote from: Anguz on May 11, 2006, 03:14:17 AM
I don't know if I will at all. At worst, I'll just package the code I have for this mod now and make an installer for 1.1, at best, I'll re-write the whole code trying to make it even faster. The problem I have is that this took me quite a bit of time the first time and it looks like that much more to do it better, and I don't have time for this lately. That's why I'm also waiting for 1.1 Final, because so many things change between each pre-final version, that updating is pretty time-consuming. I hope you understand my reason.
Yeap. Then i guess what i have to do best is to pray that SMF 1.1 Final will come out asap which the developer itself didn't know when is the release date for it :( :( :(
Not working with 1.07 english/german so far. I'm still trying to make it work.
Quote from: Anguz on May 11, 2006, 03:14:17 AM
I don't know if I will at all. At worst, I'll just package the code I have for this mod now and make an installer for 1.1, at best, I'll re-write the whole code trying to make it even faster. The problem I have is that this took me quite a bit of time the first time and it looks like that much more to do it better, and I don't have time for this lately. That's why I'm also waiting for 1.1 Final, because so many things change between each pre-final version, that updating is pretty time-consuming. I hope you understand my reason.
Well, I think it would really be appreciated if you made a version for SMF1.1RC2 plus the fact that 1.1RC2 is available quite long allread... ;)
I don't expect that SMF 1.1 Final will come soon... ;)
Does anyone know what download I should use if I'm running SMF 1.0.7? Can you let me know where I can get it?
Well rumor dose have it that SMF 1.1 rc3 is close. ??? 8)
does it works for the new SMF 1.7 ??? ???
Hi,
I get "Execute Modification ./Sources/Subs.php Test failed"
the mods I have installed are:
1. Enchanced post template 1.0.1
2. Reason For Editing Mod 1.12
3. php BBC Button 1.0
4. Hide Tag 1.18
5. Googlebot & Spiders Mod 1.0.5
6. Contact Page 1.0
7. Reg Bar 1.0
8. Skype Name Mod 2.0
9. Ad Managment 2.0
10. AutoSig 1.1
11. Referral Module 1.1
12. Moderator Activity Report for SMF1.1RC2 1.1a
13. Custom Profile Field Mod 3.11
14. Spoiler Tag 0.2.5
15. User Email System 1.0
16. Guest Nag 1.1
17. SMF Staff Page 1.2
18. Redirection Boards 2.0
19. CAPTCHA (code verification) 0.1
20. Global Announcements 1.0
21. Users Online Today Mod 1.4.0 Beta 2
22. VisualWarning 1.3
23. Skype Name Mod 1.0
24. Username Tag 1.2
25. Lots_o_Smileys 1.0
26. SMF 1.0.7 / 1.1 RC2 Update 1.0
27. Paid Subscriptions 0.7
Avatar Packages
Mod Name Version
1. Horoscope Avatars 1.0
2. WOW dancing avatars 1.0
Is this because I have 1.1rc2, if so please can you make it for 1.1rc2 noob friendly ;)
I need a mod but it says Faster Parsecode most be installed first, so please help
Many thanks :)
1.1 has an entirely different bbc parser to 1.0 so it isn't needed.
Hi, I tried to install it, but now I'm getting this message:
Parse error: parse error, unexpected T_IF, expecting ')' in /storage/mijndomein/users/042093/public/sites/www.vgmemporium.com/smf/Sources/Subs.php on line 947
I tried to un-install it and delete the mod, but I can't access my Package Manager because of the install failure.
I can't get anywhere now, what do I have to do?
Quote from: heartless bowser on September 05, 2006, 01:04:12 PM
Hi, I tried to install it, but now I'm getting this message:
Parse error: parse error, unexpected T_IF, expecting ')' in /storage/mijndomein/users/042093/public/sites/www.vgmemporium.com/smf/Sources/Subs.php on line 947
I tried to un-install it and delete the mod, but I can't access my Package Manager because of the install failure.
I can't get anywhere now, what do I have to do?
Which version do you use? Because this mod doesn't work on any RC... ;)
Version 1.0.8.
I'm kinda new at using SMF... I've been on SMF forums before as a regular member. But this is my first time as an Admin. (for SMF that is, I've been Admin on a Invision Power Board before SMF, but SMF's Admin Panel differs very much (in a better way too!) from IPB.)
Well, it has been said to install the spoiler tag mod, you needed to change the XML file from 1.0.5 to 1.0.8.
I figured that would work for the FasterParsecode mod too, but appearently I must've missed something.
Failure on Subs.php in SMF 1.0.10. Forum has the following mods running:
Streaming
LSP Enigma 2.0
LSP Captcha
There'll be a ny update to the SMF 1.1.1 ?
Since, I need this mod to install other mods, I'm waiting an update of this.
TIA.
Vanscot
I believe I've said it before, but in case I didn't, here it goes: I would love to re-write the parsecode function for 1.1, but I seriously doubt I'll have the time or drive to do it. If you want to use my mod in 1.1, though, you could getting your hands a little dirty with the code, but I would advice to just use the default function, since it'll be updated for security issues or improvement by the excellent development team here. I believe that a better approach to the resources used when displaying the messages, rather than working on this function, it'd be to have a caching of parsed messages, but that'd use more disk space in servers. But even that'd probably not be needed, since there's server caching tools that work with SMF, AFAIK.
There's a couple or so bbcode mods I wrote that I do want to make available for 1.1 and I'll find a way to write them using the standard parsecode function, though.
would your language and spoiler tag mods happen to be among them?
Any news on updating this mod to work with SMF 1.1.1 ? I need it in order to use the [anchor] tags, which is a simple thing, but won't work on SMF 1.1.1 without this mod.
Quote from: SoftDux on February 12, 2007, 10:04:04 AM
Any news on updating this mod to work with SMF 1.1.1 ? I need it in order to use the [anchor] tags, which is a simple thing, but won't work on SMF 1.1.1 without this mod.
look three posts up from this one (2 up from your post i'm replying to).
It would be great to have the custom bbcode mod and the spoiler tag for default parsecode function. I need them so badly xD
Quote from: drgnfireinferno on February 09, 2007, 08:38:00 PM
would your language and spoiler tag mods happen to be among them?
I was wondering the same thing.
I´m working with the smf 1.1.3. There´s a version compatible with this one? there will be one? if I won´t use what´s will be the diference? I can´t install some others mods?
thanks
Can you please make one for SMF 1.1.3? If u do, u wil be great.
I dont think so it is required for 1.1.3 since things have changed.
Right Dragooon, Anguz has already updated one of his mods, requiring Faster Parsecode mod in SMF 1.0x, Table from CSV (http://custom.simplemachines.org/mods/index.php?mod=40) for SMF 1.1.3 and uses the existing parsing code.
I believe, if he decides to update some more of his mods, he will follow the same way.
Quote from: agridoc on September 02, 2007, 01:31:38 PMI believe, if he decides to update some more of his mods, he will follow the same way.
Correct.
I don't feel like re-writting the whole function again and have you guys waiting for my updates after every new SMF release.
Feeling in the mood for 1.1.6? :)
this has not been posted to for over a year... I doubt it.
OK, I'm not sure what sort of reply I'm going to get - given the age of previous posts. But, I wanted to install the spoiler mod (http://custom.simplemachines.org/mods/index.php?mod=50) and it states that this one is a pre-requisite.
I'm on 1.1.10 so I went to the manual install instructions for 1.1.10 and it said to search for
Quote// Parses the code in message, using the normal syntax used by some many forums...
function parsecode(&$message)
{
global $modSettings, $scripturl, $txt, $settings, $context;
static $codefromcache = array(), $codetocache = array();
// If it wasn't already set, set it.
if (empty($codefromcache))
{
So, I looked in my Sources/Subs.php - and there is no code like that. I do have something like this:
Quotefunction parse_bbc($message, $smileys = true, $cache_id = '')
{
global $txt, $scripturl, $context, $modSettings, $user_info;
static $bbc_codes = array(), $itemcodes = array(), $no_autolink_tags = array();
static $disabled;
// Never show smileys for wireless clients. More bytes, can't see it anyway :P.
if (WIRELESS)
$smileys = false;
elseif ($smileys !== null && ($smileys == '1' || $smileys == '0'))
$smileys = (bool) $smileys;
if (empty($modSettings['enableBBC']) && $message !== false)
{
Anyone any ideas?
Many Thanks
Faster Parsecode was written for SMF 1.0x, is abandoned now. It's not compatible with SMF 1.1, 2.0 has even more changes in parse code.
If you want Spoiler Tag mod, it's code should be changed, so better ask in Spoiler Tag (http://www.simplemachines.org/community/index.php?topic=19831.0).
Anguz had written some excellent mods for SMF 1.0.
Hi - and thanks. I found another one written by AzaToth and Motoko-chan - which works for 1.1.10, so no need to persist here.
So, my issue is solved now.
Cheers
This doesnt work for SMF RC1.2 theres a manual install for it, but this isnt even in the subs.php
// Parses the code in message, using the normal syntax used by some many forums...
function parsecode(&$message)
{
global $modSettings, $scripturl, $txt, $settings, $context;
static $codefromcache = array(), $codetocache = array();
// If it wasn't already set, set it.
if (empty($codefromcache))
{
// If any tags are disabled then we won't add them.
if (!empty($modSettings['disabledBBC']))
{
$disabled = array_flip(explode(',', $modSettings['disabledBBC']));
foreach ($disabled as $tag => $dummy)
$disabled[trim($tag)] = true;
}
$code_to_from = array(
// A named email address. [[email protected]]me[/email] And, you can't have []s in your email, I should know.
'~\[email=([^<">]+?)\](.+?)\[/email\]~ie' => isset($disabled['email']) ? '"$2 ($1)"' : '"<a href=\"mailto:" . strtr("$1", array("\"" => """, "]" => "", "[" => "")) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
// An image. Width and height can be are optional.
'~\[img(\s+width=([\d]+))?(\s+height=([\d]+))?\s*\](?:<br />)*([^<">]+?)(?:<br />)*\[/img\]~ie' => isset($disabled['img']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "@")))' : '"<img src=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$5", array("@" => "@", "\"" => """))) . "\" alt=\"\"" . ("$2" != "" ? " width=\"$2\"" : "") . ("$4" != "" ? " height=\"$4\"" : "") . " border=\"0\" />"',
// Find an inside link. (named?) ie. [iurl]www.simplemachines.org[/iurl]
'~\[iurl=([^<">]+?)\](.+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[flash.*?\]|\[/flash\]|\[/iurl\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"' : 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
'~\[iurl\]([^<">]+?)\[/iurl\]~ie' => isset($disabled['iurl']) ? (!isset($disabled['url']) ? '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">$1</a>"' : '"$1"') : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[iurl.*?\]|\[/iurl\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\">$1</a>"',
// FTP link. Named...? [ftp=upload.sourceforge.net]Sourceforge[/ftp]
'~\[ftp\]([^<">]+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$1")' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array("@" => "@"))) . "</a>"',
'~\[ftp=([^<">]+?)\](.+?)\[/ftp\]~ie' => isset($disabled['ftp']) ? 'preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\]|\[ftp.*?\]|\[/ftp\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
// Find a (named?) URL... [url]www.simplemachines.org[/url] or [url=www.simplemachines.org]SMF[/url]
'~\[url=([^:\]<">]+?)\]([^\]]*?\[url(?:=[^\]<">]+?)?\][^<">]+?\[/url\].*?)\[/url\]~ie' => isset($disabled['url']) ? 'preg_replace("~(\[url.*?\]|\[/url\])~i", "", "$2") . " ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . preg_replace("~(\[url.*?\]|\[/url\])~i", "", strtr("$2", array("@" => "@"))) . "</a>"',
'~\[url=([^<">]+?)\](.+?)\[/url\]~ie' => isset($disabled['url']) ? '"$2 ($1)"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">" . strtr("$2", array("@" => "@")) . "</a>"',
'~\[url\](?:<br />)*([^<">]+?)(?:<br />)*\[/url\]~ie' => isset($disabled['url']) ? '"$1"' : '"<a href=\"" . preg_replace("~(\[url.*?\]|\[/url\]|\[flash.*?\]|\[/flash\]|\[img.*?\]|\[/img\]|\[email.*?\]|\[/email\])~i", "", strtr("$1", array(":" => ":", "\"" => """))) . "\" target=\"_blank\">$1</a>"',
// Bold, italics, underline, strikeout.
'~\[b\](.+?)\[/b\]~i' => isset($disabled['b']) ? '$1' : '<b>$1</b>',
'~\[i\](.+?)\[/i\]~i' => isset($disabled['i']) ? '$1' : '<i>$1</i>',
'~\[u\](.+?)\[/u\]~i' => isset($disabled['u']) ? '$1' : '<span style="text-decoration: underline;">$1</span>',
'~\[s\](.+?)\[/s\]~i' => isset($disabled['s']) ? '$1' : '<del>$1</del>',
// A quote. May or may not specify an author and/or link and date.
'~\[quote(?: author)?="(.{1,80}?)"\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',
'~\[quote author=(.{1,80}?) link=(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?) date=(\d+)\](?:<br />)?~ei' => isset($disabled['quote']) ? '\'<div>\'' : '\'<div class="quoteheader"><a href="' . $scripturl . '?$2">' . $txt['smf239'] . ': $1 ' . $txt[176] . ' \' . timeformat(\'$3\') . \'</a></div><div class="quote">\'',
'~\[quote author=(.{1,80}?)\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf239'] . ': $1</div><div class="quote">',
'~\[quote\](?:<br />)?~i' => isset($disabled['quote']) ? '<div>' : '<div class="quoteheader">' . $txt['smf240'] . '</div><div class="quote">',
'~\[/quote\](?:<br />)?~i' => isset($disabled['quote']) ? '</div>' : '</div>',
// Size the font. [size=large]HELLO![/size]
'~\[size=([\d]{1,2}p[xt]|(?:x-)?small(?:er)?|(?:x-)?large[r]?)\](.+?)\[/size\]~i' => isset($disabled['size']) ? '$2' : '<span style="font-size: $1;">$2</span>',
'~\[size=([\d])\](.+?)\[/size\]~i' => isset($disabled['size']) ? '$2' : '<font size="$1">$2</font>',
// Performat/justify text. [center]Justifying is good.[/center]
'~\[pre\](.+?)\[/pre\]~i' => isset($disabled['pre']) ? '$1' : '<pre>$1</pre>',
'~\[left\](.+?)\[/left\]~i' => isset($disabled['left']) ? '$1' : '<div align="left">$1</div>',
'~\[right\](.+?)\[/right\]~i' => isset($disabled['right']) ? '$1' : '<div align="right">$1</div>',
'~\[center\](.+?)\[/center\]~i' => isset($disabled['center']) ? '$1' : '<div align="center">$1</div>',
// Teletyped text. Monospace, in other words.
'~\[tt\](.+?)\[/tt\]~i' => isset($disabled['tt']) ? '$1' : '<tt>$1</tt>',
// Subscript and superscript. 6[sup]2[/sup] = 36.
'~\[sub\](.+?)\[/sub\]~i' => isset($disabled['sub']) ? '$1' : '<sub>$1</sub>',
'~\[sup\](.+?)\[/sup\]~i' => isset($disabled['sup']) ? '$1' : '<sup>$1</sup>',
// An email address. [email][email protected][/email]
'~\[email\](?:<br />)*(.+?)(?:<br />)*\[/email\]~ie' => isset($disabled['email']) ? '"$1"' : '"<a href=\"mailto:" . strtr("$1", array(":" => ":", "\"" => """, "[" => "", "]" => "")) . "\">$1</a>"',
// Specify a specific font. [font=Comic Sans]Blah![/font]
'~\[font=([\w,\-\s]+?)\](.+?)\[/font\]~i' => isset($disabled['font']) ? '$2' : '<span style="font-family: $1;">$2</span>',
// Colors.... [red]See?[/red]
'~\[color=(#[\da-fA-F]{3}|#[\da-fA-F]{6}|[\w]{1,12})\](.*?)\[/color\]~i' => isset($disabled['color']) ? '$2' : '<span style="color: $1;">$2</span>',
'~\[(black|white|red|green|blue)\](.+?)\[/\1\]~i' => isset($disabled['color']) ? '$2' : '<span style="color: $1;">$2</span>',
'~\[(chr|k)issy\](.+?)\[/\1issy\]~i' => isset($disabled['color']) ? '$2' : '<span style="color: #CC0099;">$2 :-*</span>',
// Lists... [list][*]First, ...[o]Second![li]THIRD!!![/li][/list]
'~\[list\](?:<br />)?~i' => isset($disabled['list']) || isset($disabled['li']) ? '' : '<ul style="margin-top: 0; margin-bottom: 0;">',
'~\[/list\](?:<br />)?~i' => isset($disabled['list']) || isset($disabled['li']) ? '' : '</ul>',
'~(?:<br />| |\s)*\[li\](.+?)\[/li\](?:<br />| |\s)*~i' => isset($disabled['list']) || isset($disabled['li']) ? '<br />$1<br />' : '<li>$1</li>',
// Horizontal rule. [hr] => ------------------.
'~\[hr(?:\s*/)?\]~i' => isset($disabled['hr']) ? '' : '<hr />',
// A break. [br] or [br /]. (it makes no sense to disable this one :P.)
'~\[br(?:\s*/)?\]~i' => '<br />',
// Right-to-left and left-to-right strings.
'~\[(ltr|rtl)\](.+?)\[/\1\]~i' => isset($disabled['ltr']) || isset($disabled['rtl']) ? '$2' : '<div dir="$1">$2</div>',
// Acronyms and abbreviations... [acronym=Bulletin Board Code]BBC[/acronym]
'~\[abbr=((?:")?)(.+?)\\1\](.+?)\[/abbr\]~ie' => isset($disabled['abbr']) ? '"$3 ($2)"' : '"<abbr title=\"" . strtr("$2", array("\"" => """)) . "\">$3</abbr>"',
'~\[acronym=((?:")?)(.+?)\\1\](.+?)\[/acronym\]~ie' => isset($disabled['acronym']) ? '"$3 ($2)"' : '"<acronym title=\"" . strtr("$2", array("\"" => """)) . "\">$3</acronym>"',
// [me=Comment]does something[/me]
'~\[me=((?:")?)(.{1,80}?)\\1\](.+?)\[/me\](?:<br />)?~i' => isset($disabled['ftp']) ? '/me $3<br />' : '<div class="meaction">* $2 $3</div>',
// An email address they just typed in. Don't match if there's already a mailto: or = before it.
'~(?<=[\?\s\xA0[\]()*\\\;>]|^)([\w\-\.]{1,80}@[\w\-]+\.[\w\-\.]+[\w\-])(?=[?,\s\xA0\[\]()*\\\]|$|<br />| |>|<|"|'|\.(?:\.| |\s|$|<br />))~i' => '<a href="mailto:$1">$1</a>',
'~(?<=<br />)([\w\-\.]{1,80}@[\w\-]+\.[\w\-\.]+[\w\-])(?=[?\.,\s\xA0\[\]()*\\\]|$|<br />| |>|<|"|')~i' => '<a href="mailto:$1">$1</a>',
// This last one fixes spaces at the beginning of lines.
'~<br /> ~' => '<br /> ',
// Match a table... hopefully with everything in the right place.
'~\[table\](?:\s|\xA0|<br />| )*((?:\[tr\](?:\s|\xA0|<br />| )*\[td\]).*?(?:(?:\s|\xA0|<br />| )*\[/td\]\[/tr\])*)(?:\s|\xA0|<br />| )*\[/table\](?:\s|\xA0|<br />| )?~i' => '<table>$1</table>',
);
$codefromcache = array_keys($code_to_from);
$codetocache = array_values($code_to_from);
// GLOWING or /shadowed/ text.
$codefromcache[] = '~\[glow=([#\w]{3,12}),([012]\d{1,2}|\d{1,2})(,[^]]+)?\](.+?)\[/glow\]~i';
$codetocache[] = isset($disabled['glow']) ? '$4' : '<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Glow(color=$1, strength=$2); font: inherit;">$4</td></tr></table> ';
$codefromcache[] = '~\[shadow=([#\w]{3,12}),(left|right|top|bottom|[0123]\d{0,2})\](.+?)\[/shadow\]~ei';
$codetocache[] = isset($disabled['shadow']) ? 'strtr(\'$3\', array(\'\\"\' => \'"\'))' : '\'<table border="0" cellpadding="0" cellspacing="0" style="display: inline; vertical-align: middle; font: inherit;"><tr><td style="filter: Shadow(color=$1, direction=\' . (isset($shadow_directions[\'$2\']) ? $shadow_directions[\'$2\'] : (int) \'$2\') . \'); font: inherit;">\' . strtr(\'$3\', array(\'\\"\' => \'"\')) . \'</td></tr></table> \'';
// Moving text... [move]stuff[/move]
$codefromcache[] = '~\[move\](.+?)\[/move\]~i';
$codetocache[] = isset($disabled['move']) ? '$1' : '<marquee>$1</marquee>';
// Handle flash.
$codefromcache[] = '~\[flash=(\d+),(\d+)\](?:<br />)*([^<>]+?)(?:<br />)*\[/flash\]~ie';
if (empty($modSettings['enableEmbeddedFlash']) || isset($disabled['flash']))
$codetocache[] = isset($disabled['url']) ? '"$3"' : '"<a href=\"" . strtr("$3", array("\"" => """)) . "\" target=\"_blank\">$3</a>"';
// Internet Explorer for Windows.
elseif ($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])
$codetocache[] = '"<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"$1\" height=\"$2\"><param name=\"movie\" value=\"" . strtr("$3", array("\"" => """)) . "\" /><param name=\"play\" value=\"true\" /><param name=\"loop\" value=\"true\" /><param name=\"quality\" value=\"high\" /><param name=\"AllowScriptAccess\" value=\"never\" /><embed src=\"" . strtr("$3", array("\"" => """)) . "\" width=\"$1\" height=\"$2\" play=\"true\" loop=\"true\" quality=\"high\" AllowScriptAccess=\"never\" /><noembed><a href=\"" . strtr("$3", array("\"" => """)) . "\" target=\"_blank\">$3</a></noembed></object>"';
// Anything else.
else
$codetocache[] = '"<embed type=\"application/x-shockwave-flash\" src=\"" . strtr("$3", array("\"" => """)) . "\" width=\"$1\" height=\"$2\" play=\"true\" loop=\"true\" quality=\"high\" AllowScriptAccess=\"never\" /><noembed><a href=\"" . strtr("$3", array("\"" => """)) . "\" target=\"_blank\">$3</a></noembed>"';
}
// Nothing to parse... ?
if (!strstr($message, '[') && !strstr($message, '://') && !strstr($message, '@') && !strstr($message, '/me') && !strstr($message, '<'))
return;
$message = strtr($message, array('$' => '$'));
// Replace <a href="something">somewhere</a> with HTML.
if (!empty($modSettings['enablePostHTML']) && strstr($message, '<'))
{
$message = preg_replace('~<a\s+href=(?:")?(?:\[url\])?((?:http://|ftp:/\|https://|ftps://|mailto:).+?)(?:\[/url\])?(?:")?>(.+?)</a>~ie', '\'<a href="$1">\' . preg_replace(\'~(\[url.*?\]|\[/url\])~\', \'\', \'$2\') . \'</a>\'', $message);
// Do <img ... /> - with security... action= -> action-.
preg_match_all('~<img\s+src=(?:")?(?:\[url\])?((?:http://|ftp://|https://|ftps://).+?)(?:\[/url\])?(?:")?(?:\s+alt=(?:")?(.*?)(?:")?)?(?:\s?/)?>~i', $message, $matches, PREG_PATTERN_ORDER);
if (!empty($matches[0]))
{
$replaces = array();
foreach ($matches[1] as $match => $imgtag)
{
// No alt?
if (!isset($matches[2][$match]))
$matches[2][$match] = '';
// Remove action= from the URL - no funny business, now.
if ($imgtag != preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag))
$replaces[$matches[0][$match]] = '<img src="' . preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag) . '" alt="' . $matches[2][$match] . '" border="0" />';
// Check if the image is larger than allowed.
if (!empty($modSettings['maxwidth']) && !empty($modSettings['maxheight']))
{
list ($width, $height) = url_image_size($imgtag);
if ($width > $modSettings['maxwidth'] || $height > $modSettings['maxheight'])
{
if ($width > $modSettings['maxwidth'] && !empty($modSettings['maxwidth']))
{
$height = floor($modSettings['maxwidth'] / $width * $height);
$width = $modSettings['maxwidth'];
if ($height > $modSettings['maxheight'] && !empty($modSettings['maxheight']))
{
$width = floor($modSettings['maxheight'] / $height * $width);
$height = $modSettings['maxheight'];
}
}
else
{
if ($height > $modSettings['maxheight'] && !empty($modSettings['maxheight']))
{
$width = floor($modSettings['maxheight'] / $height * $width);
$height = $modSettings['maxheight'];
}
}
}
// Set the new image tag.
$replaces[$matches[0][$match]] = '<img src="' . preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag) . '" width="' . $width . '" height="' . $height . '" alt="' . $matches[2][$match] . '" border="0" />';
}
elseif (strpos($matches[0][$match], '[url]') !== false || substr($matches[0][$match], 0, 4) == '<')
$replaces[$matches[0][$match]] = '<img src="' . preg_replace('~action(=|%3d)(?!dlattach)~i', 'action-', $imgtag) . '" alt="' . $matches[2][$match] . '" border="0" />';
}
$message = strtr($message, $replaces);
}
}
// Do the code if necessary.
if (strstr($message, '[') || strstr($message, '://') || strstr($message, '@') || strstr($message, '/me'))
{
$shadow_directions = array('left' => '270', 'right' => '90', 'top' => '0', 'bottom' => '180');
$message = preg_replace($codefromcache, $codetocache, $message);
// Tables need to be done twice or they won't work properly.
if (strpos($message, '<table>') !== false)
{
for ($i = 0; $i < 2; $i++)
$message = preg_replace(
array(
'~((?:<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />| )*(?:<tr>|\[tr\])|</td>|\[/td\])(?:\s|\xA0|<br />| )*\[td\](?:\s|\xA0|<br />| )*(.*?)(?:\s|\xA0|<br />| )*\[/td\](?:\s|\xA0|<br />| )*((?:</tr>|\[/tr\])(?:\s|\xA0|<br />| )*(?:<tr>|\[tr\]|</table>)|<td(?: valign="top")?>|\[td\])~i',
'~(<table>|</tr>|\[/tr\])(?:\s|\xA0|<br />| )*\[tr\](?:\s|\xA0|<br />| )*(.*?)(?:\s|\xA0|<br />| )*\[/tr\](?:\s|\xA0|<br />| )*(</table>|<tr>|\[tr\])~i'
),
array(
'$1<td valign="top">$2</td>$3',
'$1<tr>$2</tr>$3'
), $message
);
}
}
// Enable Basic HTML?
if (!empty($modSettings['enablePostHTML']) && strstr($message, '<'))
{
// b, u, i, s, pre... basic tags.
$closable_tags = array('b', 'u', 'i', 's', 'pre', 'blockquote');
foreach ($closable_tags as $tag)
{
$opens = substr_count($message, '<' . $tag . '>');
$closes = substr_count($message, '</' . $tag . '>');
$message = str_replace(array('<' . $tag . '>', '</' . $tag . '>'), array('<' . $tag . '>', '</' . $tag . '>'), $message);
if ($closes < $opens)
$message .= str_repeat('</' . $tag . '>', $opens - $closes);
}
// <br /> should be empty.
$empty_tags = array('br');
foreach ($empty_tags as $tag)
$message = str_replace(array('<' . $tag . '>', '<' . $tag . '/>', '<' . $tag . ' />'), '<' . $tag . ' />', $message);
}
}
well, since the last update for this mod was in 2006, I am fairly certain that it will not work on smf 2.0 at all
can someone update this a lot of bbcode mods need this
Better off updating the mods than updating this mod.