vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Mimetex (https://vborg.vbsupport.ru/showthread.php?t=68116)

the_sisko 08-07-2004 10:00 PM

Mimetex
 
As I promised in this thread some time ago, I will post a short install note on how to get mimetex to work on vB.

1.
You need to download the mimeTex source files to compile and install mimeTeX. I don't know if it is allowed to attached the compied mimetex.cgi file, nor do I know if there is something server specific in my file. So you have to do this on your own. Compile and installation instruction can be found in the mimetex source files.
http://moodle.org/download/mimetex/source/mimetex.html
EDIT (2005-06-14):Added the mimetex.cgi file as attachment

2.
Upload the mimetex.cgi file to a folder on your server where it could be used. As we don't wanted our users or anybody else to access this file, we put it outside the webserver root.

3. Create a folder on your webserver where the mimeTex images should be stored.

4.
Open the atteched functions_mimetex.php and alter the three variables at the beginning to your needs. Upload the attached functions_mimetex.php file to your /includes/ folder.

5.
Open /includes/functions_bbcodeparse.php
Find:
PHP Code:

    // end smilies 

below add:
PHP Code:

  // Latex Hack by CDK
    
require_once('functions_mimetex.php');   
    
$bbcode mimetex($bbcode); 

upload altered file.

6. If everything went right you should now can use [tex]\frac{x^3 + 2 x^2 - 6 x + 7}{x^2+1}[/tex] which results in http://www.chemieonline.de/images/fo...97a0d49e15.gif


I've put up some samples in the zip file. More samples by one of our Moderators can be found here: http://www.studenten-city.de/forum/s...91&postcount=1


It was a hack made for our forum, I have no further interest in developing this into a real stabel hack. Its working for us. I posted this, just to give other users who needed this a start into the right direction.

the_sisko 08-08-2004 01:57 PM

Saved for future need.

Erwin 08-09-2004 12:29 PM

Very cool! :)

Gary King 08-10-2004 05:40 PM

Interesting stuff, I will install this soon enough.

Highlander 08-11-2004 04:24 AM

sry my english is not the best and i didnt understand what mimetext does?!

can you explain it in simple words for meplease?

the_sisko 08-11-2004 06:33 AM

Quote:

Originally Posted by Highlander
sry my english is not the best and i didnt understand what mimetext does?!

can you explain it in simple words for meplease?

[german]
Wie w?re es auf deutsch?
Mimetex erlaubt es einem Latex/Tex Formeln im Forum einzubinden. So kann man z.B. mathematische, chemische, physikalische Formeln sehr sch?n darstellen. Schau Dir einfach mal die Beispiele im ZIP an oder auf der Webseite die ich gelinkt habe.
[/german]

Streicher 08-16-2004 04:04 PM

After The_Sisko wrote this new cool hack for our site, i make an addition for users, who don't know much about Mimetex. They can now insert mimtex code with one mouse click, just like the smilies.

Find in vbulltin_editor.js:
PHP Code:

window.open("misc.php?" SESSIONURL "do=getsmilies&wysiwyg=" wysiwyg "&forumid=" forumid"smilies""statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=" x_width ",height=" y_width);


Right below add:
PHP Code:

function open_mimetex_window(x_widthy_widthwysiwygforumid)
{
    if (
typeof(forumid) == "undefined")
    {
        
forumid 0;
    }
    
window.open("tex.php?" SESSIONURL "do=getsmilies&wysiwyg=" wysiwyg "&forumid=" forumid"smilies""statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,width=" x_width ",height=" y_width);


Save and Upload.

Make a new file called "tex.php" (based upon: https://vborg.vbsupport.ru/showthread.php?t=62164):
PHP Code:

<?php 

// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''tex'); // change this depending on your filename 

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array( 

); 

// get special data templates from the datastore 
$specialtemplates = array( 
     
); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
    
'mimetex'
); 

// pre-cache templates used by specific actions 
$actiontemplates = array( 

); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php'); 

// ####################################################################### 
// ######################## START MAIN SCRIPT ############################ 
// ####################################################################### 

$navbits = array(); 
$navbits[$parent] = 'Mimetex'

$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 
eval(
'print_output("' fetch_template('mimetex') . '");'); 

?>

Save and Upload to your forum folder.

Go into your AdminCp and make a new template called "mimetex" (Some parts are german, but you can easily make your own text). Insert the content of the attached file and check the path to your mimetex.cgi

Then open template "editor_toolbar_standard" and find
PHP Code:

<!-- end control bar --></div><!-- / end control bar --> 

Above it add (just an example, your can put it where you want in this template):
PHP Code:

<!-- fourth control row -->
    <
div class="controlholder">
        <
a href="#" onclick="open_mimetex_window(700, 400, $wysiwyg, '$forumid'); return false" title="Mimetex">Mimetex</a>
    </
div

Have fun!

TnT 08-24-2004 08:00 PM

If you run Windows as OS, replace this line:

PHP Code:

$command "$mimetex_path -e ".$full_path_filename." ".escapeshellarg($mimetex_formula); 

with this line:

PHP Code:

$command "$mimetex_path -e ".$full_path_filename." \" ".$mimetex_formula."\""

Thomas

kur1j 08-27-2004 07:58 PM

Maybe its just me but it seems very unclear in step 3. Create a folder on your webserver where the mimeTex images should be stored.

What pictures?

Streicher 08-27-2004 09:08 PM

Quote:

Originally Posted by kur1j
Maybe its just me but it seems very unclear in step 3. Create a folder on your webserver where the mimeTex images should be stored.

What pictures?

With the Mimetex Code in the posts the mimetex.cgi creates images on thy fly. The folder is for these images.


All times are GMT. The time now is 01:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01133 seconds
  • Memory Usage 1,773KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete