PDA

View Full Version : vBH-Add New Tabs [updated Patch Level 1 - unofficial]



admin
21-11-2009, 04:44 PM
vBH-Add new tabs 1.2 with no querys
Mark as installed, if you use it http://www.vbulletin.org/forum/images/smilies/smile.gif


If you like this modification please suport it in the mod of the moth poll (http://www.vbulletin.org/forum/showthread.php?t=234672) http://www.vbulletin.org/forum/images/smilies/smile.gif


What does this plugin?
This plugin allows you to add new tabs in the navigation bar to link to any site you want.

Installation:
Import the xml file from the product manager..
Upload the files in the upload folder to your forums via ftp.

To add new tabs, go to:
vBulletin Options> VBH New Tabs Option


Configuration example:

AdminCP|/admincp/=>self;6
google|http://www.google.com=>self;1 2
vbulletin|http://www.vbulletin.com=>self;1 2
yahoo|http://www.yahoo.com=>self;1 2
vbulletin.org|http://www.vbulletin.org=>self;1 2

To make tab selected:
This option only works if your tab links to internal files. You need to enter the THIS_SCRIPT value under the option Tabs Selected.

Also note that some areas of vBulletin already use the THIS_SCRIPT value in their code and because of this some tabs may not work correctly. A example of this would be the usercp.php file. If you make a tab linking to this file and then you enter the value 'usercp' to make it selected, the tab will be selected but also will be the forum tab. This is because vBulletin used this value in the navbar template.

You won't have problems when linking to custome pages.

en español
vBHispano - Agregar Pestañas en Español (http://www.vbhispano.com/foros/f31/vbh_agregar_nuevas_pestanas_1_0_a-15400/#post81219)


History:
11-23-09: First release 1.0

Ability to add tabs with option to disable the modification.
11-23-09: Update 1.1

Some bug fixes
New option to align the tabs on the left, right or center.
Now you can choose which usergroup can view each tab.
Links can now be set to open in a new window or the same window.
12-24-09

Updated to work on vB4 Gold
02-08-10: Update 1.2

Added option to make the tab selected, please read the product options.
Added option to disable the default tabs Home, Blogs and What's New. At this time tab forum can't be removed.
20-09-11: Update 1.2 Patch Level 1 (Built by Getamped 1404 - Tiểu Bá Vương 1404)

Fixed with usergroups permission bug.
Optimize plugins.

ngthtg
19-01-2010, 12:01 PM
cái này có xài cho vbb 4.0.1 được đâu =))

hueddc
19-01-2010, 11:56 PM
chỉ dùng cho bản beta 4.0.0 rc cũng hok dc nè :MatCuoi (20):

Tiểu Bá Vương 1404
20-09-2011, 01:38 PM
Chào các bạn,

Sau một thời gian theo dõi, mình nhận thấy có nhiều bạn gặp khó khăn với tiện ích này, đặc biệt là phần phân quyền cho nhóm được thấy, không được thấy một tab bất kì, đồng thời cũng không có tín hiệu cập nhật phiên bản mới sửa lỗi của tác giả nên mình mạo muội viết bản vá lỗi Patch Level 1 - Đây là phiên bản không chính thức.

Với phiên bản này :

Sửa lỗi phân quyền nhóm thành viên.
Tối ưu hoá toàn diện cho code PHP của plugins.

Mình không sửa phần bản quyền tác giả nên vẫn sẽ xuất hiện text link ở footer.

jamesblackvn
19-10-2011, 02:03 PM
Hỏi cái ngày ngoài lề tí hen, thấy trong mod có phần này mà không hiểu THIS_SCRIPT dùng để làm gì :(



Tabs Selected



Here you may add values for THIS_SCRIPT as defined in your custom pages or vbulletin files. Exaple:
For calendar.php you may add calendar as this is the value defined for THIS_SCRIPT in calendar.php file.

Insert each value comma separated.

Tiểu Bá Vương 1404
19-10-2011, 06:34 PM
Ở đây nó thiên về góc độ người lập trình vì sử dụng hàm và biến PHP.
Biến THIS_SCRIPT dùng để xác định tên của tập tin PHP mà được sử dụng trong vBulletin, ví dụ, với tập tin forum.php, nó được định danh là "index".
Tiếp theo, THIS_SCRIPT được sử dụng trong hàm define(). Cụ thể với ví dụ trên ta có :

define ('THIS_SCRIPT', 'index');
Bạn có thể tìm thấy định danh THIS_SCRIPT của các tập tin PHP sử dụng trong vBulletin tương tự như vậy.

Về công dụng, nó có nhiều mặt, nhưng ở đây đề cập đến phần tab và navbar, mình xin nói ngắn gọn thế này : Ví như mỗi tab tương ứng với một tập tin PHP (ví dụ tập tin search.php ứng với định danh của nó là "search"). Nếu không dùng câu điều kiện PHP để định danh cho tab đó thì khi ta trỏ nó tới tập tin search.php sẽ vẫn hiển thị ở tab "Forum" thay vì tab "What's New?". Câu lệnh điều kiện ở đây là :

<vb:if condition="THIS_SCRIPT == 'search'">...</vb:if>

jamesblackvn
20-10-2011, 12:01 AM
Sau khi mò mò một hồi với this sờ rít thì rút ra kết luận, đối với mod này, nếu ko thêm this sript của các tập tin mới (ví dụ như vbshop.php) thì khi bấm vào tab vBShop thì phần chọn vẫn ở forum :D

https://lh5.googleusercontent.com/-kcHmZn1K-uk/Tp8A1z1-nwI/AAAAAAAADAw/iGQl9GTj9ho/ninhhoa.org-ts1.png
https://lh5.googleusercontent.com/-39kDbK9ds8s/Tp8A4aegdqI/AAAAAAAADA0/evmBQdYJJqo/ninhhoa.org-ts2.png



Cám ơn vì đã giải thích hộ

Tiểu Bá Vương 1404
20-10-2011, 12:54 PM
vBShop đã có plugin tạo tab cho nó và hoạt động bình thường, trừ phi đã vô hiệu hóa nó sau đó mới phải làm bằng tay thế này !

jamesblackvn
20-10-2011, 02:27 PM
uhm. phải disble chức năng hiện tab của VBshop rồi thử mà :D