## MathJax

### Old posts with latex not converted

Hello,

i switched over from phpbb2 to phpbb3. In phpbb3 I can create new posts with latex and they are convertered / shown as graphics. The problem is, that the old posts made during phpbb2 show only the bbcode in the posts if you open them. But if you open them i edit mode and safe them again, it's working. It seems to be a general bbcode problem. My impression is, that in phpbb3 the bbcodes are processed / converted when the post is saved and in phpbb2 the latex graphics were produced when shown in the browser.

Is there a possibility to safe all posts of the bulletin board again to process the bbcode?

I am using this bbcode replacement

$${TEXT}$$ => <img src="/cgi-bin/mimetex.cgi?{TEXT}">

Your extension seems to do something similar but also does not automatically convert old posts.
beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am
Contact:

### Re: Old posts with latex not converted

I could see about writing some sort of converter, but I'm currently on vacation. Also, just for completeness, you upgraded to phpBB 3.2?
Kailey Truscott - Community Team
kinerity
Community Team Member
Posts: 1943
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

### Re: Old posts with latex not converted

I am using 3.2, yes. A converter would be great. An alternative would be to adapt the procedure from phpbb 2:

Code: Select all

$text = preg_replace($patterns, $replacements,$text);
$text = preg_replace('/$tex$(.*?)$\/tex$/ie', "'<img src=\"/cgi-bin/mimetex.cgi?'.rawurlencode('$1').'\" />'", $text); // mimetex The question is if it is possible to adapt this approach to phpBB 3.2 and the new structure of bbcode.php beta5 Registered User Posts: 24 Joined: Sun Jun 10, 2018 8:54 am Contact: ### Re: Old posts with latex not converted beta5 wrote: The problem is, that the old posts made during phpbb2 show only the bbcode in the posts if you open them. But if you open them i edit mode and safe them again, it's working. You probably need to wait the core code to automatically reparse all of your posts, or even better use the CLI to reparse them at once. Want to compensate me for my interest? Donate Please PM me only to request paid works. Thx. Extensions, Scripts, MOD porting, Update/Upgrades My development's activity º PhpStorm's proud user 3Di Registered User Posts: 12987 Joined: Mon Apr 04, 2005 11:09 pm Location: Milan (IT) Frankfurt (DE) Name: Marco Contact: ### Re: Old posts with latex not converted I made some research on CLI. As I don't have shell access, I learned that cronjobs are executed on pageviews. But obviously not every cron job on each pageview. I would like to use the cronjobservice cronjob.de to accelerate the reparsing. What is the corresponding call? Is that correct? I cannot see if this call does anything. The extension "Cron Status" cannot recognize the last execution date ("Auto"). https://domain.com/cron.php?cron_type=c ... er.pm_text beta5 Registered User Posts: 24 Joined: Sun Jun 10, 2018 8:54 am Contact: ### Re: Old posts with latex not converted 3Di wrote: beta5 wrote: The problem is, that the old posts made during phpbb2 show only the bbcode in the posts if you open them. But if you open them i edit mode and safe them again, it's working. You probably need to wait the core code to automatically reparse all of your posts, or even better use the CLI to reparse them at once. I tried using cli with the command Code: Select all php bin/phpbbcli.php --safe-mode reparser:reparse --ansi but I always only get the error essage: Parse eror: syntax error, unexpected '[' in /home/www/...forum/bin/phpbbcli.php on line 76 It seems not to be a problem of the command, as also standard commands like php bin/phpbbcli.php list from the tutorial https://area51.phpbb.com/docs/dev/3.1.x ... arted.html do produce the same error. I am using phpBB 3.2.2, PHP Version 5.5.30 and Putty to access the command line. beta5 Registered User Posts: 24 Joined: Sun Jun 10, 2018 8:54 am Contact: ### Re: Old posts with latex not converted This is for 3.2 https://area51.phpbb.com/docs/dev/3.2.x ... arted.html Tested with PHP 5.5.38 and other versions too, and it works. https://prntscr.com/jyfgsw You should be able to raise your PHP in cPanel, else ask your host. Parse eror: syntax error, unexpected '[' in /home/www/...forum/bin/phpbbcli.php on line 76 That happened with PHP 5.3.28 here, not supported by phpBb 3.2.xx. If you comment that line 76 this way //$language->set_default_language($phpbb_container->get('config')['default_lang']); you will see if it starts or indicates you something about your PHP version currently running, like: acer@acer-PC MINGW64 /c/wamp64/www/QI/boards/322_test$ /c/wamp64/bin/php/php5.3.28/php bin/phpbbcli.php reparser:reparse --ansi

You are running an unsupported PHP version. Please upgrade to PHP 5.4.0 or higher before trying to install or update to phpBB 3.2
Filed a bug report https://tracker.phpbb.com/browse/PHPBB3-15705
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
My development's activity º PhpStorm's proud user
3Di
Registered User
Posts: 12987
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

### Re: Old posts with latex not converted

Hm, the PHP version is not the problem I think. I switched between version and got:

- 5.3.29: "not supported, please update > 5.4" => expected
- 5.5.30: Error on line 76 as reported above
- 5.6.16: Same as for 5.5.30
- 7.x.: Some kind of sql error

When I comment line 76 as suggested, I also get the message "not supported, please update > 5.4" even if 5.5 or 5.6. is active.

I checked the running php version with the phpinfo in phpbb.
beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am
Contact:

### Re: Old posts with latex not converted

beta5 wrote:- 7.x.: Some kind of sql error
That's not helping, you are seeking help and therefore you should provide detailed error reports.
beta5 wrote: - 5.5.30: Error on line 76 as reported above
- 5.6.16: Same as for 5.5.30
Try and apply this code changes.
https://github.com/phpbb/phpbb/pull/526 ... da079644b4
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
My development's activity º PhpStorm's proud user
3Di
Registered User
Posts: 12987
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

### Re: Old posts with latex not converted

Both 5.5 and 5.6 say the same with the recommended changes in phpbbcli.php:
You are running and unsupported PHP version. Please upgrade to 5.4.0 or higher before trying to install or update to phpBB 3.2
Might it be worth checking if special php settings you have are mandatory and maybe deactive on my webserver?
beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am
Contact:

### Re: Old posts with latex not converted

I strongly believe your board is NOT running on the same PHP you are switching to, somewhere.

Last call:

go to ACP and in the landing page, at the top, there are the statistics (total posts, total topics, db version, nr. of attachments etc..)...
... there you will find the PHP and phpBB version which effectively your board is running on.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
My development's activity º PhpStorm's proud user
3Di
Registered User
Posts: 12987
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

### Re: Old posts with latex not converted

For proof see screenshots below:
Attachments
php1.png (4.33 KiB) Viewed 51 times
beta5
Registered User
Posts: 24
Joined: Sun Jun 10, 2018 8:54 am
Contact:

### Re: Old posts with latex not converted

This is not anymore an extension's support issue, nor a phpBB support issue as well.

This is now a problem you should solve with your host. IMHO.

All what I can say is, it should run without issues looking at your screenshot.

Ask you host if there is some .htaccess rule which is overriding your PHP with another which is less than 5.4. (Already seen)

Good luck.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.