Tabbed website based ULX motd

TABBED WEBSITE BASED ULX MOTD
HOW TO INSTALL:
Go into garrysmod/addons/ulx/lua/ulx/modules/cl/motdmenu.lua
Just replace the old lua script with this one then add your wedsites and everything! (REMOVE WWW. FROM YOU WEBSITE LINKS)
Save and exit!


ulx.motdmenu_exists = true

local isUrl
local url

function ulx.showMotdMenu()
	local url1 = "1WEBSITE LINK HERE"
	local url2 = "2WEBSITE LINK HERE"
	local url3 = "3WEDSITE LINK HERE"

	local window = vgui.Create( "DFrame" )
	if ScrW() > 640 then -- Make it larger if we can.
		window:SetSize( ScrW()*0.9, ScrH()*0.9 )
	else
		window:SetSize( 640, 480 )
	end
	window:Center()
	window:SetTitle( "SERVER NAME HERE" )
	window:SetVisible( true )
	window:MakePopup()
	
	local tabmenu = vgui.Create( "DPropertySheet", window )


	local html1 = vgui.Create( "HTML" )
	local html2 = vgui.Create( "HTML" )
	local html3 = vgui.Create( "HTML" )

	local button = vgui.Create( "DButton", window )
	button:SetText( "Close" )
	button.DoClick = function() window:Close() end
	button:SetSize( 100, 40 )
	button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )
	
	tabmenu:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 )
	tabmenu:SetPos( 10, 30 )

	html1:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
	html1:SetPos( 15, 50 )
	html1:OpenURL( url1 )
	
	html2:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
	html2:SetPos( 15, 50 )
	html2:OpenURL( url2 )
	
	html3:SetSize( window:GetWide() - 30, window:GetTall() - button:GetTall() - 70 )
	html3:SetPos( 15, 50 )
	html3:OpenURL( url3 )
	
	tabmenu:AddSheet( "1TAB NAME HERE", html1, _, "materials/icon16/world.png", false, _)
	tabmenu:AddSheet( "2TAB NAME HERE", html2, _, "materials/icon16/medal_gold_add", false, _)
	tabmenu:AddSheet( "3TAB NAME HERE", html3, _, "materials/icon16/application_put.png", false, _)
end

function ulx.rcvMotd( isUrl_, text )
	isUrl = isUrl_
	if not isUrl then
		ULib.fileWrite( "data/ulx_motd.txt", text )
	else
		if text:find( "://", 1, true ) then
			url = text
		else
			url = "http://" .. text
		end
	end
end

Uh, what exactly is the point of this if you can make tabs in HTML part of MOTD already?

BECAUSE ITS HARD AS SHIT TO FIND THE SCRIPT. so i posted it on here :slight_smile:

Eeeee, what? First, what you posted is half-broken edit of original MOTD which you shouldn’t touch at all. Second, HTML tabs aren’t hard to make, there are even JS helper libraries for this which are easy to find.

nah, the script isnt broke. works Just fine for me :slight_smile:

I didn’t say it’s broken completely, it’s half-broken because it ignores some stuff like ulx.rcvMotd() callback that was supposed to set client’s MOTD when server requests. I really don’t understand why not just make HTML tabs, it doesn’t require dicking around with ULX internals.

http://andreblue.com/firav/
This is done with bootstrap to allow the tabs. Just used javascript to change the tab on click. They have some other things they can do also. http://getbootstrap.com/ is the main website.