math equations (with latex)

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
lethe
Registered User
Posts: 21
Joined: Wed Jun 08, 2005 11:51 am

phpbb3

Post by lethe » Fri Dec 15, 2006 6:32 am

I'm thinking of upgrading to phpbb3. If latexrender can't support it, that's a showstopper for me. Tell me, has it been tried already? Does it work? How hard would it be to get it working? Should I try it?

stevem
Registered User
Posts: 398
Joined: Sun Aug 25, 2002 1:59 pm

Post by stevem » Fri Dec 15, 2006 12:54 pm

You'll be pleased to hear that LatexRender works fine with phpBB 3.0 Beta4. In fact in some ways it is even easier to install :)
Here are the small changes you need to make to the installation - of course things may change a little when phpBB 3.0 is finally released.
  1. In phpbb_hook_2.php:
    replace $uid by $bbcode_uid twice
    replace $text by $message six times
  2. In includes/bbcode.php there only needs to be one extra line
    Just before

    Code: Select all

    		// Remove the uid from tags that have not been transformed into HTML
    		$message = str_replace(':' . $this->bbcode_uid, '', $message);
    	}
    
    	/**
    	* Init bbcode cache
    	*
    	* requires: $this->bbcode_bitfield
    	* sets: $this->bbcode_cache with bbcode templates needed for bbcode_bitfield
    	*/
    	function bbcode_cache_init()
    Add (with appropriate path)

    Code: Select all

    include("/home/username/public_html/forum/latexrender/phpbb_hook_2.php");
  3. In the Administration Control Panel, Posting, Add a new BBCode
    1. In the top box put

      Code: Select all

      [tex]{TEXT}[/tex]
    2. Helpline text is whatever you want to tell your users
    3. Check Display on Posting
    4. Submit
You should now be able to use LatexRender as before. If you try it out (remember that phpBB3 should only be used for testing at the moment) let me know if there's a problem.

lethe
Registered User
Posts: 21
Joined: Wed Jun 08, 2005 11:51 am

Post by lethe » Sat Dec 16, 2006 8:55 am

stevem wrote: You'll be pleased to hear that LatexRender works fine with phpBB 3.0 Beta4.


Hey Steve. It worked like a charm. I guess you've already tried this and figured it all out! Thanks for your hard work.

angelp1ay
Registered User
Posts: 175
Joined: Tue Dec 23, 2003 1:32 pm
Location: Bristol, UK
Contact:

Post by angelp1ay » Mon Dec 18, 2006 3:02 pm

29 pages eh? Any chance theres a mod thread in MODs in Development or MOD Release Announcements & Support? I'd rather not trall through 29 pages of posts to find installation instructions...

stevem
Registered User
Posts: 398
Joined: Sun Aug 25, 2002 1:59 pm

Post by stevem » Mon Dec 18, 2006 3:09 pm

I understand your point but the installation instructions are in the download at http://www.mayer.dial.pipex.com/tex.htm . Ask here or via email for help if there's a problem. Someone is working on getting the mod approved.

angelp1ay
Registered User
Posts: 175
Joined: Tue Dec 23, 2003 1:32 pm
Location: Bristol, UK
Contact:

Post by angelp1ay » Mon Dec 18, 2006 4:59 pm

Great. Just didn't want to have to read 29 pages just to get a download link (I usually check the first and last posts). Thank you stevem :)

maurorodas
Registered User
Posts: 10
Joined: Thu Feb 15, 2007 2:02 pm
Location: Manizales/Colombia
Contact:

Post by maurorodas » Thu Feb 15, 2007 2:54 pm

Hi, this is my first post in the forum.

I'm installing the mimetex in my forum, but I'm not able to make him to work.

The mimetex.cgi work

Code: Select all

<img src="http://alkimiya.awardspace.com/forum/mimetex/cgi-bin/mimetex.cgi?x^2">
but the bbcode [tex]x^2[/tex] doesn't make it.

my paths of phpbb_hook_2


Code: Select all

		// --------------------------------------------------------------------------------------------------
		// adjust this to match your system configuration
		$mimetex_path = "http://alkimiya.awardspace.com/forum/mimetex/cgi-bin/mimetex.cgi";
		$mimetex_path_http = "http://alkimiya.awardspace.com/forum/mimetex";
		$mimetex_cgi_path_http="http://alkimiya.awardspace.com/forum/mimetex/cgi-bin/mimetex.cgi";
		$pictures_path = "http://alkimiya.awardspace.com/forum/mimetex/pictures";
		// --------------------------------------------------------------------------------------------------
Will they be not well configured?

I have installed the Advance BBcode Box, and I have made the following changes

Code: Select all

#-----[ OPEN ]---------------------------------------------
/mods/bbcode_box/bbcode_box.js

#
#-----[ FIND ]---------------------------------------------
sub_help = "Subíndice: [sub]texto[/sub]";

# 
#-----[ AFTER, ADD ]-------------------------------------- 
tex_help = "Latex: [tex]código[/tex]"; 

#
#-----[ FIND ]---------------------------------------------

var subscript = 0;

# 
#-----[ AFTER, ADD ]-------------------------------------- 
var tex = 0; 

#
#-----[ FIND ]---------------------------------------------
} else {
		ToAdd = "[/list]";
		document.listdf.src = "mods/bbcode_box/images/list.gif";
		List = 0;
	}
	PostWrite(ToAdd);
}

# 
#-----[ AFTER, ADD ]-------------------------------------- 
   function BBCtex() {  
      var txtarea = document.post.message;  
       
     if ((clientVer >= 4) && is_ie && is_win) {  
         theSelection = document.selection.createRange().text;  
          if (theSelection != '') {  
           document.selection.createRange().text = "[tex]" + theSelection + "[/tex]";  
          document.post.message.focus();  
          return;  
         }  
      }  
      else if (txtarea.selectionEnd && (txtarea.selectionEnd - txtarea.selectionStart > 0))  
      {  
          mozWrap(txtarea, "[tex]", "[/tex]");  
      return;  
      }  
      if (tex == 0) {  
          ToAdd = "[tex]";  
         document.post.tex.src = "mods/bbcode_box/images/tex1.gif";  
          tex = 1;  
     } else {  
         ToAdd = "[/tex]";  
         document.post.tex.src = "mods/bbcode_box/images/tex.gif";  
         tex = 0;  
     }  
      PostWrite(ToAdd);  
   } 

does the button appear, and does it put [tex] in area of the text, but doesn't it work, what is it bad?

the CHMOD es 755, I changed it at 777, and it shows me the following error

Code: Select all

Warning: bbencode_first_pass(http://alkimiya.awardspace.com/forum/mimetex/phpbb_hook_1.php): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 387

Warning: bbencode_first_pass(): Failed opening 'http://alkimiya.awardspace.com/forum/mimetex/phpbb_hook_1.php' for inclusion (include_path='.:/usr/local/php4/share/pear') in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 387

Warning: Cannot modify header information - headers already sent by (output started at /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php:387) in /home/www/alkimiya.awardspace.com/forum/includes/page_header.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php:387) in /home/www/alkimiya.awardspace.com/forum/includes/page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php:387) in /home/www/alkimiya.awardspace.com/forum/includes/page_header.php on line 486
thank you for their help

maurorodas
Registered User
Posts: 10
Joined: Thu Feb 15, 2007 2:02 pm
Location: Manizales/Colombia
Contact:

Post by maurorodas » Thu Feb 15, 2007 8:08 pm

answers??

stevem
Registered User
Posts: 398
Joined: Sun Aug 25, 2002 1:59 pm

Post by stevem » Thu Feb 15, 2007 9:06 pm

maurorodas wrote:

Code: Select all

		// --------------------------------------------------------------------------------------------------
		// adjust this to match your system configuration
		$mimetex_path = "http://alkimiya.awardspace.com/forum/mimetex/cgi-bin/mimetex.cgi";
		$mimetex_path_http = "http://alkimiya.awardspace.com/forum/mimetex";
		$mimetex_cgi_path_http="http://alkimiya.awardspace.com/forum/mimetex/cgi-bin/mimetex.cgi";
		$pictures_path = "http://alkimiya.awardspace.com/forum/mimetex/pictures";
		// --------------------------------------------------------------------------------------------------
You have confused the web URL with the path on the server.

Code: Select all

$mimetex_path = "http://alkimiya.awardspace.com/forum/mimetex/cgi-bin/mimetex.cgi";
$pictures_path = "http://alkimiya.awardspace.com/forum/mimetex/pictures";
should not point to the URL but to where they are on the computer. So you should have something like (though I am guessing where they are)

Code: Select all

$mimetex_path = "/home/www/alkimiya.awardspace.com/cgi-bin/mimetex.cgi";
$pictures_path = "/home/www/alkimiya.awardspace.com/forum/mimetex/pictures";
which are the paths on the server.

maurorodas
Registered User
Posts: 10
Joined: Thu Feb 15, 2007 2:02 pm
Location: Manizales/Colombia
Contact:

Post by maurorodas » Thu Feb 15, 2007 11:26 pm

thanks, but now gives the following error

Code: Select all

Warning: bbencode_second_pass(/home/www/alkimiya.awardspace.com/public_html/forum/mimetex/phpbb_hook_2.php): failed to open stream: No such file or directory in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 223

Warning: bbencode_second_pass(): Failed opening '/home/www/alkimiya.awardspace.com/public_html/forum/mimetex/phpbb_hook_2.php' for inclusion (include_path='.:/usr/local/php4/share/pear') in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 223

Warning: bbencode_second_pass(/home/www/alkimiya.awardspace.com/public_html/forum/mimetex/phpbb_hook_1.php): failed to open stream: No such file or directory in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 229

Warning: bbencode_second_pass(): Failed opening '/home/www/alkimiya.awardspace.com/public_html/forum/mimetex/phpbb_hook_1.php' for inclusion (include_path='.:/usr/local/php4/share/pear') in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 229

:( :( :( :(

stevem
Registered User
Posts: 398
Joined: Sun Aug 25, 2002 1:59 pm

Post by stevem » Fri Feb 16, 2007 1:01 pm

maurorodas wrote:

Code: Select all

Warning: bbencode_second_pass(/home/www/alkimiya.awardspace.com/public_html/forum/mimetex/phpbb_hook_2.php): failed to open stream: No such file or directory in /home/www/alkimiya.awardspace.com/forum/includes/bbcode.php on line 223
This is telling you that phpbb_hook_2.php can't be found in /home/www/alkimiya.awardspace.com/public_html/forum/mimetex/.

Is it in /home/www/public_html/forum/mimetex/ or /home/www/alkimiya.awardspace.com/forum/mimetex or somewhere else? I can't know your system. You need to adjust the lines you put in bbcode.php telling it where to find phpbb_hook_1.php and phpbb_hook_2.php.

maurorodas
Registered User
Posts: 10
Joined: Thu Feb 15, 2007 2:02 pm
Location: Manizales/Colombia
Contact:

Post by maurorodas » Fri Feb 16, 2007 2:34 pm

stevem I already corrected the path, and no error is no longer presented, but don't leave the equation, leave this:

Code: Select all

[tex:5b32f542ee]x^2[/tex:5b32f542ee] 
:( :( :(

thank you for your help

stevem
Registered User
Posts: 398
Joined: Sun Aug 25, 2002 1:59 pm

Post by stevem » Fri Feb 16, 2007 5:25 pm

That means it is making it to phpbb_hook_2.php but not being processed. Try changing $system_disabled=0; to $system_disabled=1; in phpbb_hook_2.php to see if that works.

That uses a different method that is more server intensive and doesn't use a cache, but it's worth trying temporarily to see if we can pin down the problem.

maurorodas
Registered User
Posts: 10
Joined: Thu Feb 15, 2007 2:02 pm
Location: Manizales/Colombia
Contact:

Post by maurorodas » Fri Feb 16, 2007 8:24 pm

I already made it but it doesn't work :( :(

Code: Select all

[tex:f97d41b918]x^2[/tex:f97d41b918]

stevem
Registered User
Posts: 398
Joined: Sun Aug 25, 2002 1:59 pm

Post by stevem » Fri Feb 16, 2007 9:17 pm

Are you absolutely sure that you put the line for phpbb_hook_2.php in the right place in bbcode.php?

Code: Select all

#
#-----[ FIND ]---------------------------------------------
#
# near line 195
#
// Patterns and replacements for URL and email tags..
$patterns = array();
$replacements = array();

#
#-----[ AFTER, ADD ]--------------------------------------
#
// for LaTeX bbcode. remember, use your path below
include("/home/username/public_html/forum/latexrender/phpbb_hook_2.php");

Post Reply

Return to “[2.0.x] MOD Requests”

Who is online

Users browsing this forum: No registered users and 2 guests