hỏi code gõ công thức toán học

dhv49

MasterCorporal
Tham gia
14/03/2015
Bài viết
280
Được Like
176
Cho mình hỏi code chèn vào xenforo để gõ được công thức toán học
 
  • Like
Reactions: THB

dinhhai

MasterCorporal
Tham gia
28/07/2015
Bài viết
399
Được Like
198
Không biết bác đa làm được chưa nhưng mà hnay mới thấy topic này. Nếu chưa thì bác tham khảo nhé

Bước 1: Nhìn file đính kèm của mình, download về máy và giải nén ra lun nhé. Sau đó kết nối hosting diễn đàn rồi úp vào thư mục js (Ngang hàng ngoài index.php).

Bước 2:
Vào templates -> Create new templates tên colorbox với nội dung code như sau:
<link media="screen" rel="stylesheet" href="js/colorbox/colorbox.css" />
<xen:require js="js/colorbox/jquery.colorbox.js" />
<xen:require js="js/latex/editor.js" />
<script type="text/javascript">
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$(".group1").colorbox({rel:'group1'});
$(".group2").colorbox({rel:'group2', transition:"fade"});
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
$(".group4").colorbox({rel:'group4', slideshow:true});
$(".ajax").colorbox();
$(".youtube").colorbox({iframe:true, innerWidth:425, innerHeight:344});
$(".iframe").colorbox({iframe:true, width:"90%", height:"90%"});
$(".latex").colorbox({iframe:true, width:"65%", height:"80%"});
$(".inline").colorbox({inline:true, innerWidth:250,innerHeight:220});
$(".callbacks").colorbox({
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
return false;
});
});
</script>

Tiếp theo mở template PAGE_CONTAINER ra, tìm đến dòng:

<xen:include template="page_container_js_head" />

Enter xuống xòng và chèn bên dưới đoạn code sau:
<xen:include template="colorbox" />

Bước 3: Tạo file latex.html với nội dung sau rồi úp lên thư mục root (Ngang hàng với index.php)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css"
href="js/latex/equation-embed.css" />

<script type="text/javascript"
src="js/latex/eq_config.js" ></script>
<script type="text/javascript"
src="js/latex/eq_editor-lite-11.js" ></script>
</head>
<div id="editor" align="center"></div>
<p align="center"><img id="equation" /></p>
<p align="center"><textarea id="testbox" rows="6" cols="80"></textarea></p>
<p align="center">Copy phần dưới và dán vào bài viết</p>
<p align="center"><textarea id="exportarea1" rows="4" cols="80"></textarea></p>
<script type="text/javascript">
EqEditor.embed('editor');
var a=new EqTextArea('equation', 'testbox');
EqEditor.add(a,false);
a.addExportArea('exportarea1','phpBB');
</script>
<body>
</body>
</html>

Bước 4: Bây giờ là gọi nó ra thôi, các bạn muốn đặt là text link hay button đều đc nhé, mình sẽ hướng dẫn đặt button cạnh những nút đăng chủ đề, hay lưu thay đổi khi edit bài và cạnh button thêm tùy chọn ở quick reply.
- Thêm vào Create Threads
Mở template thread_create và tìm
<input type="button" value="{xen:phrase preview}..." class="button PreviewButton JsOnly" />

Thêm bên dưới.

<a class="latex" href="latex.html" title="Trình soạn thảo công thức"><input type="submit" value="Gõ công thức" accesskey="s" class="button primary" /></a>

- Thêm vào Post edit
Mở template post_edit tìm
<input type="button" value="{xen:phrase preview}..." class="button PreviewButton JsOnly" />

Thêm bên dưới
<a class="latex" href="latex.html" title="Trình soạn thảo công thức"><input type="submit" value="Gõ công thức" accesskey="s" class="button primary" /></a>

- Thêm vào quick reply
Mở template quick_reply
tìm
<xen:include template="attachment_upload_button" />
Thêm bên dưới
<a class="latex" href="latex.html" title="Trình soạn thảo công thức"><input type="submit" value="Gõ công thức" accesskey="s" class="button primary" /></a>

Bước 5: Còn 1 bước cuối cùng nữa là tạo bbcode
Vào bbcode manager -> Create new bbcode
BBcode tag: tex
ví dụ: [tex]x^2 + 3 = 5[/tex]
Check Activate BB Code

Nguồn lượm lặt trên mạng và đang xài ổn
 

connhagiau89

Private
Tham gia
30/08/2015
Bài viết
29
Được Like
13
Không biết bác đa làm được chưa nhưng mà hnay mới thấy topic này. Nếu chưa thì bác tham khảo nhé

Bước 1: Nhìn file đính kèm của mình, download về máy và giải nén ra lun nhé. Sau đó kết nối hosting diễn đàn rồi úp vào thư mục js (Ngang hàng ngoài index.php).

Bước 2: Vào templates -> Create new templates tên colorbox với nội dung code như sau:


Tiếp theo mở template PAGE_CONTAINER ra, tìm đến dòng:



Enter xuống xòng và chèn bên dưới đoạn code sau:


Bước 3: Tạo file latex.html với nội dung sau rồi úp lên thư mục root (Ngang hàng với index.php)



Bước 4: Bây giờ là gọi nó ra thôi, các bạn muốn đặt là text link hay button đều đc nhé, mình sẽ hướng dẫn đặt button cạnh những nút đăng chủ đề, hay lưu thay đổi khi edit bài và cạnh button thêm tùy chọn ở quick reply.
- Thêm vào Create Threads
Mở template thread_create và tìm


Thêm bên dưới.



- Thêm vào Post edit
Mở template post_edit tìm


Thêm bên dưới


- Thêm vào quick reply
Mở template quick_reply
tìm

Thêm bên dưới


Bước 5: Còn 1 bước cuối cùng nữa là tạo bbcode
Vào bbcode manager -> Create new bbcode
BBcode tag: tex
ví dụ: [tex]x^2 + 3 = 5[/tex]
Check Activate BB Code

Nguồn lượm lặt trên mạng và đang xài ổn

Mình đang cần cái này, thím còn giữ file đính kèm ko cho xin với ^^!
 

Hướng dẫn sử dụng

XenForo 1 XenForo 2
Translate by PVS

Dịch vụ XenForo của VNXF

Mr. Tuấn

Mobile/Zalo: 0988 488 096

Telegram: bluekpro

Email: [email protected]

Nhà Tài Trợ

Mút Xốp Không Gian
pallet Thịnh Phát
Top Bottom