Thread: Profile Enhancements - Mood Manager - with AJAX mood update.
View Single Post
  #495  
Old 07-18-2007, 12:10 PM
selwonk's Avatar
selwonk selwonk is offline
 
Join Date: Jul 2005
Location: Manchester, UK
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just to speed the process up, if you create/rename your mood icons, this little bit of VBscript will create a file called _List.txt which looks like this:
Code:
Aggressive
Amazed
Amused
Angelic
Angry
Apprehensive
Approved
Asleep
Bahahaha
...
Wasted
Where
Wicked
Woot
Yeehaw
Just create a _List.vbs text file in the \images\mood\ folder and paste this code
Code:
	Function FileExists( str_FileName )
		Set obj_FSO = CreateObject("Scripting.FileSystemObject")
		If (obj_FSO.FileExists(str_FileName)) Then
			FileExists = True
		Else
			FileExists = False
		End If
		Set obj_FSO = Nothing
	End Function

	Function WriteToFile( str_FileName, str_Message )
		Set obj_FSO = CreateObject("Scripting.FileSystemObject")
		Set obj_OutputFile = obj_FSO.OpenTextFile(str_FileName, 2, True, 0)
		obj_OutputFile.WriteLine(str_Message)
	    obj_OutputFile.Close
	    Set obj_OutputFile = Nothing
		Set obj_FSO = Nothing
	End Function

	Function ReadTextFile( str_FileName )
		int_ReadTextFileCounter = 0
		While FileExists(str_FileName) = False And int_ReadTextFileCounter < 1000 ' 3.0
			int_ReadTextFileCounter = int_ReadTextFileCounter + 1
			' Wait for file to be created
		Wend

		Set obj_FSO = CreateObject("Scripting.FileSystemObject")
		Set obj_InputFile = obj_FSO.GetFile(str_FileName)
		Set obj_TextStream = obj_InputFile.OpenAsTextStream(1, TristateFalse)
		str_Text = obj_TextStream.ReadAll
	    Set obj_InputFile = Nothing
		Set obj_FSO = Nothing
		ReadTextFile = str_Text
	End Function

	Sub DeleteFile( str_FileName )
    	Set obj_FSO = CreateObject("Scripting.FileSystemObject")
		If obj_FSO.FileExists(str_FileName) Then
			obj_FSO.DeleteFile(str_FileName)
		End if
		Set obj_FSO = Nothing
	End Sub
	
	' Parameters
	Set obj_FSO = CreateObject("Scripting.FileSystemObject")
	GBL_IN = obj_FSO.GetAbsolutepathname("") & "\"
	GBL_OUT = obj_FSO.GetAbsolutepathname("_List.txt")
	Set obj_FSO = Nothing

	Set obj_FSO = CreateObject("Scripting.FileSystemObject")
	Set obj_Folder = obj_FSO.GetFolder(GBL_IN)

	str_Log = ""

	For Each obj_File In obj_Folder.Files
		str_FileName = obj_File.Name
		If Right(str_FileName, 4) = ".gif" Then
			WScript.Echo str_FileName
			str_Log = str_Log & Left(str_FileName, Len(str_FileName) - 4) & vbcrlf
		End If
	Next

	Set obj_Folder = Nothing
	Set obj_FSO = Nothing

	WriteToFile GBL_OUT, str_Log
Get to a DOS prompt, change to that folder and type
Code:
cscript _List.vbs
Edit the resultant file and paste the results into the Admin CP

Hope that helps...
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01074 seconds
  • Memory Usage 1,769KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete