Sign in to follow this  
Followers 0
Alek

freeware list project.

21 posts in this topic

#1 ·  Posted (edited)

Thought this might be a cool forum project <_<

This is a small MySQL based cool and usfull freeware list, still a work in progress (got 3 programs on it atm, autoit and autoit beta begin 2 of them :P )

and you help make it larger :)

Todo:

-make the search function.

-make it work better in vista.

To add a program to the list you just press "add application" and type the details needed in the gui:

this dosent work atm, working it...

-Name = the name of the program

-Download URL = the link to the program (has to be all the way to the end, like this: http://www.autoitscript.com/cgi-bin/getfil...it-v3-setup.exe

and not just: http://www.autoitscript.com/autoit3/downloads.shtml

-Section = what kind of program is it, section is for the not yet implanted search function

-Description = a short Description of what the program does

No longer needs mysql

#include <File.au3>
#include <String.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>
#NoTrayIcon
#RequireAdmin

Global $Data[1][5]

$Top = "Name|Version|Section|Description"
$Old_Sel_Index = 1
$Old_Srch_Input = ""
$Size = 0
$Old_Size = 0

DirCreate(@ScriptDir & "\Temp")
InetGet("http://alek900.itrello.com/autoit.php",@ScriptDir & "\Temp\apps.html",1)
$Data = FileRead(@ScriptDir & "\Temp\apps.html")
$Data = _StringBetween($Data,"<xyz>","</xyz>")

$Form1 = GUICreate("", 400, 460)
$ListView1 = GUICtrlCreateListView($Top, 5, 5, 490, 200)
_GUICtrlListViewHideColumn($ListView1, 3)
$Button1 = GUICtrlCreateButton("Download", 5, 210, 100, 20)
$Button2 = GUICtrlCreateButton("Add Application", 110, 210, 100, 20)
GUICtrlSetState($Button2,$GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("", 5, 235, 390, 20, $SS_SUNKEN+$SS_CENTER)
$Edit1 = GUICtrlCreateEdit("", 5, 380, 390, 70, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetBkColor(-1, 0xffffff)

GUICtrlCreateLabel("Filter:", 5, 262)
$Search_Input = GUICtrlCreateInput("", 35, 260, 360, 20)

GUICtrlCreateGroup("Filter by...", 5, 290, 390, 70)
$Name_Radio = GUICtrlCreateRadio("Name", 20, 310)
$Old_Radio = $Name_Radio
GUICtrlSetState(-1, 1)

$Section_Radio = GUICtrlCreateRadio("Section", 260, 310)
$Version_Radio = GUICtrlCreateRadio("Version", 20, 330)
$Description_Radio = GUICtrlCreateRadio("Description", 260, 330)

GUISetState(@SW_SHOW)


Global $Filter_Array = _GetApps()

$Form2 = GUICreate("Add Application",200,235,-1,-1,-1,$WS_EX_TOOLWINDOW, $Form1)
$Form2_Input1 = GUICtrlCreateInput("Name",5,5,190,20)
$Form2_Input2 = GUICtrlCreateInput("Download URL",5,30,190,20)
$Form2_Input3 = GUICtrlCreateInput("Section",5,55,190,20)
$Form2_Input4 = GUICtrlCreateInput("Version",5,80,190,20)
$Form2_Input5 = GUICtrlCreateEdit("Description",5,105,190,100)
$Form2_Button1 = GUICtrlCreateButton("Add Application",5,210,190,20)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
        Case $GUI_EVENT_CLOSE
            If $nMsg[1] = $Form1 Then
                ExitLoop
            ElseIf $nMsg[1] = $Form2 Then
                GUISetState(@SW_ENABLE,$Form1)
                GUISetState(@SW_HIDE,$nMsg[1])
            EndIf
        Case $Name_Radio, $Section_Radio, $Version_Radio, $Description_Radio
            If $nMsg[0] <> $Old_Radio And GUICtrlRead($Search_Input) <> "" Then SortByFilterProc()
            $Old_Radio = $nMsg[0]
        Case $Button1
            If $Size = 0 Then
                FileDelete(@ScriptDir & "\Temp\Temp.exe")
                $URL = $Data[_GUICtrlListViewGetSelectedIndices($ListView1)+1][1]
                ;MsgBox(0,"",$URL) ;Debuging
                $Size = InetGetSize($URL)
                InetGet($URL,@ScriptDir & "\Temp\Temp.exe",1,1)
            EndIf
        Case $Button2
            GUISetState(@SW_DISABLE,$Form1)
            GUISetState(@SW_SHOW,$Form2)
        Case $Form2_Button1
            If GUICtrlRead($Form2_Input1) <> "" And GUICtrlRead($Form2_Input1) <> "Name" Then
                If GUICtrlRead($Form2_Input2) <> "" And GUICtrlRead($Form2_Input2) <> "Download URL" Then
                    If GUICtrlRead($Form2_Input3) <> "" And GUICtrlRead($Form2_Input3) <> "Section" Then
                        If GUICtrlRead($Form2_Input4) <> "" And GUICtrlRead($Form2_Input4) <> "Version" Then
                            If GUICtrlRead($Form2_Input5) <> "" And GUICtrlRead($Form2_Input5) <> "Description" Then
                                ;$Id = _CountRecords($Sql_Connection, "Software", "id")+1
                               ; _Query($Sql_Connection,"INSERT INTO Software VALUES (" & $Id & ",'" & GUICtrlRead($Form2_Input1) & "','" & GUICtrlRead($Form2_Input2) & "','" & GUICtrlRead($Form2_Input3) & "','" & GUICtrlRead($Form2_Input4) & "','" & GUICtrlRead($Form2_Input5) & "');")
                                GUICtrlSetData($Form2_Input1,"Name")
                                GUICtrlSetData($Form2_Input2,"Download URL")
                                GUICtrlSetData($Form2_Input3,"Section")
                                GUICtrlSetData($Form2_Input4,"Version")
                                GUICtrlSetData($Form2_Input5,"Description")
                                GUISetState(@SW_ENABLE,$Form1)
                                GUISetState(@SW_HIDE,$Form2)
                                _GUICtrlListViewDeleteAllItems($ListView1)
                                ;_GetApps()
                            EndIf
                        EndIf
                    EndIf
                EndIf
            EndIf
    EndSwitch
    If @InetGetActive And $Size <> 0 Then
        $Cur_Size = Round(@InetGetBytesRead/1024,0)
        If $Cur_Size-10 > $Old_Size Then ; to avoid flikering
            GUICtrlSetData($Label1,"Downloading: " & $Cur_Size & "kB\" & Round($Size/1024,0) & "kB")
            $Old_Size = $Cur_Size
        EndIf
    ElseIf Not @InetGetActive And $Size <> 0 Then
        Run(@ScriptDir & "\Temp\Temp.exe")
        GUICtrlSetData($Label1,"Done!!!")
        $Size = 0
    EndIf
    $Sel_Index = _GUICtrlListViewGetSelectedIndices($ListView1)
    If  $Sel_Index <> $Old_Sel_Index And $Sel_Index <> -1 Then
        ;MsgBox(0,"",$Sel_Index & @CRLF & UBound($Filter_Array,1))
        GUICtrlSetData($Edit1,$Filter_Array[$Sel_Index+1][4])
        $Old_Sel_Index = $Sel_Index
    EndIf
    If GUICtrlRead($Search_Input) <> $Old_Srch_Input Then SortByFilterProc()
WEnd

Exit

Func SortByFilterProc()
    $Old_Srch_Input = GUICtrlRead($Search_Input)
    
    Local $IndexFilter = 0
    Local $iCount = 0
    
    For $i = $Name_Radio To $Description_Radio
        If GUICtrlRead($i) = 1 Then
            $IndexFilter = $iCount
            ExitLoop
        EndIf
    Next
    If $Old_Srch_Input = "" Then
        _LV_Filter($ListView1, $Filter_Array, 1, -1)
    Else
        _LV_Filter($ListView1, $Filter_Array, $IndexFilter, $Old_Srch_Input)
    EndIf
EndFunc

Func _LV_Filter($S_LV, ByRef $S_LV_Array2D, $LV_Collum_index, $LV_Search_String)
    If Not IsArray($S_LV_Array2D) Then Return
    _GUICtrlListViewDeleteAllItems($S_LV)
    For $x = 1 To UBound($S_LV_Array2D) - 1
        MsgBox(0,"",$S_LV_Array2D[$x][$LV_Collum_index])
        If StringInStr($S_LV_Array2D[$x][$LV_Collum_index], $LV_Search_String) And _
        $LV_Search_String <> "" And $LV_Search_String <> -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
            GUICtrlCreateListViewItem($iData, $S_LV)
        ElseIf $LV_Search_String = -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                If $y <> 3 And $S_LV_Array2D[$x][$y] <> "" Then $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
           If $iData <> "" then GUICtrlCreateListViewItem($iData, $S_LV)
        EndIf
    Next
    ;_GUICtrlListViewHideColumn($ListView1, 3)
EndFunc   ;==>_LV_Filter

Func _GetApps()
    $Data = StringReplace(StringReplace($Data[0],"</td><td>","|"),"<td>","")
    $Data = StringReplace(StringReplace($Data,"<tr>",Chr(1)),"</td>","")
    $Data = StringReplace(StringReplace($Data,"<table border = 1>",""),"</table>","")
    $Data = StringSplit($Data,Chr(1))
    Local $Array[$Data[0]-1][5]
    For $x = 2 To $Data[0]
        If $Data[$x] <> "" Then
            $Info = StringSplit($Data[$x],"|")
            If UBound($Info) >= 6 Then
                $Array[$x-1][0] = $Info[2]
                $Array[$x-1][1] = $Info[3]
                $Array[$x-1][2] = $Info[4]
                $Array[$x-1][3] = $Info[5]
                $Array[$x-1][4] = $Info[6]
                GUICtrlCreateListViewItem($Info[2] & "|" & $Info[4] & "|" & $Info[5] & "|" & $Info[6],$ListView1)
            EndIf
        EndIf
    Next
    Return $Array
EndFunc
Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites



Nice, very nice! <_<

Here, i added some features:

* Removed the array pre-creation, it ReDim'ed dinamicly now (it should increese the startup speed).

* I added Search Filtering on-fly :) (the initial concept isn't mine)

* The description column can be hidden, just uncomment needed lines.

Check this and tell me please what do you think...

#include <File.au3>
#include <Mysql.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>
#NoTrayIcon
$objErr = ObjEvent("AutoIt.Error","MyErrFunc")
;damn you vista >:(
If @OSVersion = "WIN_VISTA" And not FileExists(@ScriptDir & "\Temp\Vista.cfg") Then
    $Input_Box1 = InputBox("","Because you are runing vista you need to enter your account name and password for the program to run porperly","Username")
    If $Input_Box1 <> "" Then
        $Input_Box2 = InputBox("","Because you are runing vista you need to enter your account name and password for the program to run porperly","Password")
    EndIf
    FileWrite(@ScriptDir & "\Temp\Vista.cfg",$Input_Box1 & @CRLF & $Input_Box2)
EndIf

Global $Data[1][5]
$Host = "SQL06.FREEMYSQL.NET"
$User = "alek900"
$Pass = "fallout2"
$port = "3306"
$DB = "autoit"
$Top = ""
$Old_Sel_Index = 0
$Old_Srch_Input = ""
$Size = 0
$Old_Size = 0

DirCreate(@ScriptDir & "\Temp")
$Sql_Connection = _MySQLConnect($User, $Pass, $Db, $Host)
$Header = _GetColNames($Sql_Connection, "Software")
For $x = 1 To $Header[0]
    If $x <> 1 And $x <> 3 Then $Top &= $Header[$x] & "|"
Next

$Form1 = GUICreate("", 400, 460)
$ListView1 = GUICtrlCreateListView($Top, 5, 5, 490, 200)
;_GUICtrlListViewHideColumn($ListView1, 3)
$Button1 = GUICtrlCreateButton("Download", 5, 210, 100, 20)
$Button2 = GUICtrlCreateButton("Add Application", 110, 210, 100, 20)
$Label1 = GUICtrlCreateLabel("", 5, 230, 390, 20, $SS_SUNKEN+$SS_CENTER)
$Edit1 = GUICtrlCreateEdit("", 5, 380, 390, 70, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetBkColor(-1, 0xffffff)

GUICtrlCreateLabel("Filter:", 5, 262)
$Search_Input = GUICtrlCreateInput("", 35, 260, 360, 20)

GUICtrlCreateGroup("Filter by...", 5, 290, 390, 70)
$Name_Radio = GUICtrlCreateRadio("Name", 20, 310)
$Old_Radio = $Name_Radio
GUICtrlSetState(-1, 1)

$Section_Radio = GUICtrlCreateRadio("Section", 260, 310)
$Version_Radio = GUICtrlCreateRadio("Version", 20, 330)
$Description_Radio = GUICtrlCreateRadio("Description", 260, 330)

GUISetState(@SW_SHOW)

Global $Filter_Array = _GetApps()

$Form2 = GUICreate("Add Application",200,235,-1,-1,-1,$WS_EX_TOOLWINDOW, $Form1)
$Form2_Input1 = GUICtrlCreateInput("Name",5,5,190,20)
$Form2_Input2 = GUICtrlCreateInput("Download URL",5,30,190,20)
$Form2_Input3 = GUICtrlCreateInput("Section",5,55,190,20)
$Form2_Input4 = GUICtrlCreateInput("Version",5,80,190,20)
$Form2_Input5 = GUICtrlCreateEdit("Description",5,105,190,100)
$Form2_Button1 = GUICtrlCreateButton("Add Application",5,210,190,20)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
        Case $GUI_EVENT_CLOSE
            If $nMsg[1] = $Form1 Then
                ExitLoop
            ElseIf $nMsg[1] = $Form2 Then
                GUISetState(@SW_ENABLE,$Form1)
                GUISetState(@SW_HIDE,$nMsg[1])
            EndIf
        Case $Name_Radio, $Section_Radio, $Version_Radio, $Description_Radio
            If $nMsg[0] <> $Old_Radio And GUICtrlRead($Search_Input) <> "" Then SortByFilterProc()
            $Old_Radio = $nMsg[0]
        Case $Button1
            If $Size = 0 Then
                FileDelete(@ScriptDir & "\Temp\Temp.exe")
                $URL = $Data[_GUICtrlListViewGetSelectedIndices($ListView1)+1][1]
                ;MsgBox(0,"",$URL) ;Debuging
                $Size = InetGetSize($URL)
                InetGet($URL,@ScriptDir & "\Temp\Temp.exe",1,1)
            EndIf
        Case $Button2
            GUISetState(@SW_DISABLE,$Form1)
            GUISetState(@SW_SHOW,$Form2)
        Case $Form2_Button1
            If GUICtrlRead($Form2_Input1) <> "" And GUICtrlRead($Form2_Input1) <> "Name" Then
                If GUICtrlRead($Form2_Input2) <> "" And GUICtrlRead($Form2_Input2) <> "Download URL" Then
                    If GUICtrlRead($Form2_Input3) <> "" And GUICtrlRead($Form2_Input3) <> "Section" Then
                        If GUICtrlRead($Form2_Input4) <> "" And GUICtrlRead($Form2_Input4) <> "Version" Then
                            If GUICtrlRead($Form2_Input5) <> "" And GUICtrlRead($Form2_Input5) <> "Description" Then
                                $Id = _CountRecords($Sql_Connection, "Software", "id")+1
                                _Query($Sql_Connection,"INSERT INTO Software VALUES (" & $Id & ",'" & GUICtrlRead($Form2_Input1) & "','" & GUICtrlRead($Form2_Input2) & "','" & GUICtrlRead($Form2_Input3) & "','" & GUICtrlRead($Form2_Input4) & "','" & GUICtrlRead($Form2_Input5) & "');")
                                GUICtrlSetData($Form2_Input1,"Name")
                                GUICtrlSetData($Form2_Input2,"Download URL")
                                GUICtrlSetData($Form2_Input3,"Section")
                                GUICtrlSetData($Form2_Input4,"Version")
                                GUICtrlSetData($Form2_Input5,"Description")
                                GUISetState(@SW_ENABLE,$Form1)
                                GUISetState(@SW_HIDE,$Form2)
                                _GUICtrlListViewDeleteAllItems($ListView1)
                                _GetApps()
                            EndIf
                        EndIf
                    EndIf
                EndIf
            EndIf
    EndSwitch
    If @InetGetActive And $Size <> 0 Then
        $Cur_Size = Round(@InetGetBytesRead/1024,0)
        If $Cur_Size-10 > $Old_Size Then ; to avoid flikering
            GUICtrlSetData($Label1,"Downloading: " & $Cur_Size & "kB\" & Round($Size/1024,0) & "kB")
            $Old_Size = $Cur_Size
        EndIf
    ElseIf Not @InetGetActive And $Size <> 0 Then
        If FileExists(@ScriptDir & "\Temp\Temp.exe") Then
            If @OSVersion = "WIN_VISTA" And FileExists(@ScriptDir & "\Temp\Vista.cfg") Then
                If FileReadLine(@ScriptDir & "\Temp\Vista.cfg",2) = "" Then
                    RunAsSet(FileReadLine(@ScriptDir & "\Temp\Vista.cfg",1),@ComputerName)
                Else
                    RunAsSet(FileReadLine(@ScriptDir & "\Temp\Vista.cfg",1),@ComputerName,FileReadLine(@ScriptDir & "\Temp\Vista.cfg",2))
                EndIf
                Run(@ScriptDir & "\Temp\Temp.exe")
                RunAsSet()
            ElseIf @OSVersion <> "WIN_VISTA" Then
                Run(@ScriptDir & "\Temp\Temp.exe")
            EndIf
        EndIf
        GUICtrlSetData($Label1,"Done!!!")
        $Size = 0
    EndIf
    $Sel_Index = _GUICtrlListViewGetSelectedIndices($ListView1)
    If  $Sel_Index <> $Old_Sel_Index Then
        GUICtrlSetData($Edit1,$Data[$Sel_Index+1][4])
        $Old_Sel_Index = $Sel_Index
    EndIf
    If GUICtrlRead($Search_Input) <> $Old_Srch_Input Then SortByFilterProc()
WEnd

_MySQLEnd($Sql_Connection)
Exit

Func SortByFilterProc()
    $Old_Srch_Input = GUICtrlRead($Search_Input)
    
    Local $IndexFilter = 0
    Local $iCount = 0
    
    For $i = $Name_Radio To $Description_Radio
        If GUICtrlRead($i) = 1 Then
            $IndexFilter = $iCount
            ExitLoop
        EndIf
        $iCount += 1
    Next
    
    If $Old_Srch_Input = "" Then
        _LV_Filter($ListView1, $Filter_Array, 1, -1)
    Else
        _LV_Filter($ListView1, $Filter_Array, $IndexFilter, $Old_Srch_Input)
    EndIf
EndFunc

Func _LV_Filter($S_LV, ByRef $S_LV_Array2D, $LV_Collum_index, $LV_Search_String)
    If Not IsArray($S_LV_Array2D) Then Return
    _GUICtrlListViewDeleteAllItems($S_LV)
    For $x = 1 To UBound($S_LV_Array2D) - 1
        If StringInStr($S_LV_Array2D[$x][$LV_Collum_index], $LV_Search_String) And _
        $LV_Search_String <> "" And $LV_Search_String <> -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
            GUICtrlCreateListViewItem($iData, $S_LV)
        ElseIf $LV_Search_String = -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
            GUICtrlCreateListViewItem($iData, $S_LV)
        EndIf
    Next
    ;_GUICtrlListViewHideColumn($ListView1, 3)
EndFunc   ;==>_LV_Filter

Func _GetApps()
    Local $RetArr[1][1]
    For $y = 0 To 4
        If $y = 0 Then
            $Info = _GetColVals($Sql_Connection, "Software","Name")
        ElseIf $y = 1 Then
            $Info = _GetColVals($Sql_Connection, "Software","Location")
        ElseIf $y = 2 Then
            $Info = _GetColVals($Sql_Connection, "Software","Section")
        ElseIf $y = 3 Then
            $Info = _GetColVals($Sql_Connection, "Software","Version")
        ElseIf $y =4 Then
            $Info = _GetColVals($Sql_Connection, "Software","Description")
        EndIf
        
        ReDim $Data[UBound($Data) + $Info[0] + 1][5]
        
        For $x = 1 To $Info[0]
            $Data[$x][$y] = $Info[$x]
        Next
    Next
    
    For $x = 1 To $Info[0]
        ReDim $RetArr[UBound($RetArr) + 1][4]
        $RetArr[$x][0] = $Data[$x][0]
        $RetArr[$x][1] = $Data[$x][2]
        $RetArr[$x][2] = $Data[$x][3]
        $RetArr[$x][3] = $Data[$x][4]
        
        GUICtrlCreateListViewItem($Data[$x][0] & "|" & $Data[$x][2] & "|" & $Data[$x][3] & "|" & $Data[$x][4], $ListView1)
    Next
    
    ;_GUICtrlListViewHideColumn($ListView1, 3)
    Return $RetArr
EndFunc

Func MyErrFunc()
    $hexnum=hex($objErr.number,8)
    Msgbox(0,"","We intercepted a COM Error!!"        & @CRLF                   & @CRLF & _
                 "err.description is: "    & $objErr.description    & @CRLF & _
                 "err.windescription is: " & $objErr.windescription & @CRLF & _
                 "err.lastdllerror is: "   & $objErr.lastdllerror   & @CRLF & _
                 "err.scriptline is: "     & $objErr.scriptline     & @CRLF & _
                 "err.number is: "         & $hexnum                 & @CRLF & _
                 "err.source is: "         & $objErr.source         & @CRLF & _
                 "err.helpfile is: "       & $objErr.helpfile       & @CRLF & _
                 "err.helpcontext is: "    & $objErr.helpcontext _
                )
    exit
EndFunc

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Nice, very nice! <_<

Here, i added some features:

* Removed the array pre-creation, it ReDim'ed dinamicly now (it should increese the startup speed).

* I added Search Filtering on-fly :P (the initial concept isn't mine)

* The description column can be hidden, just uncomment needed lines.

Check this and tell me please what do you think...

;code
i love it, was actualy going to add the same listview filter function :)

[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

Way Cool, I couldn't add anything to it tho. Gave me come errors.

Share this post


Link to post
Share on other sites

@Alek

Nice project, but is the MySQL not a bit overkill ?

Any other lightweight DB would have been better don't you think.

It would be easier to distribute and use the appllication.

Personaly I don't have MySQL on my machine so I can't run it. <_<

regards,

ptrex

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Shouldn't it be possible to include the dll (that is what it uses right? The mysql dll? I can't remember) and then to register it?

it needs the MySQL Driver that can be found on the mysql topic.

in my opinion, mysql i awsome but in autoit its crap, we really need some new UDF's (useing libMysql.dll whould be awsome)


[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

it needs the MySQL Driver that can be found on the mysql topic.

in my opinion, mysql i awsome but in autoit its crap, we really need some new UDF's (useing libMysql.dll whould be awsome)

Looks like you have found a new project <_<

Share this post


Link to post
Share on other sites

@Alek

in my opinion, mysql i awsome but in autoit its crap, we really need some new UDF's (useing libMysql.dll whould be awsome)

In my opinion you need to step away from MySQL and go for SQLite or MSI as an DB engine.

Look in my signature for the links.

regards

ptrex

Share this post


Link to post
Share on other sites

@Alek

In my opinion you need to step away from MySQL and go for SQLite or MSI as an DB engine.

Look in my signature for the links.

regards

ptrex

ok, il try.

does anyone know of any free sqlite hosts??


[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

i think sqlite is not the right database for you, i think you want to manage a database on the internet and therefore mysql is great, sqlite and msi are only for local databases on your own machine.


$a=StringSplit("547275737420796F757220546563686E6F6C75737421","")For $b=1 To UBound($a)+(-1*-1*-1)step(2^4/8);&$b+=1*2/40*µ&Asc(4)Assign("c",Eval("c")&Chr(Dec($a[$b]&$a[$b+1])))''Chr("a")&"HI"Next;time_U&r34d,ths,U-may=get$the&c.l.u.e;b3st-regards,JRSmile;MsgBox(0x000000,"",Eval("c"));PiEs:d0nt+*b3.s4d.4ft3r.1st-try:-)

Share this post


Link to post
Share on other sites

Where is mysql1.au3?


-jaenster

Share this post


Link to post
Share on other sites

But if you have acknowlegde of PHP you could write a PHP-Backend working with the database and then giving the output read by the program <_<

I like the idea connecting directly to the MySQL-Server, but only a few people have the MySQL-Driver installed and thats the reason I won't use the MySQL-UDF.

If you need some help about PHP-Backending take a look on my project. (Its definitely not the same as yours, but its a begin)

http://sourceforge.net/projects/pplayer -> CVS -> CVS-Browse -> develop -> php

I'd prefer the skin.php for beginning :)

greetings,

Pascal

Share this post


Link to post
Share on other sites

I think your Vista woes might be solved by throwing #requireadmin at the top of your script...


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

ok, now it gets the apps list from a php website that i made so you dont need mysql.au3 and/or the driver, now i have to somewhat big problems

1. how can i make it so that you can add apps to the list, im thinkin useing ie.au3 and some more clever php scripting (i didnt even know i could script php <_<)

2. i manged to destroy the search function :)


[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

Well you don't need the IE.au3. You can specify the APP to add on the program itself. And then InetGet the php with ?var1=appname&var2=url etc.

How to get the vars: $_REQUEST (google it <_<)

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Well you don't need the IE.au3. You can specify the APP to add on the program itself. And then InetGet the php with ?var1=appname&var2=url etc.

How to get the vars: $_REQUEST (google it :))

hmm, im not sure how (as i said, this the first time i have ever really workd with php <_<) but what i have seen on google, useing $_GET whould be something like.

inetget("http://alek900.itrello.com/autoit.php?name=" & $name & "&url=" & $Downloadurl & "&Version=" & $Version & "&Description=" & $Description)

if so then i just broke the $_GET Limit

Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

i manged to destroy the search function

<_< - Here is a fix for the filtering (and some more fixes), and also you not need to create an temp file to get the apps list, you can use _InetGetSource...

#NoTrayIcon
#RequireAdmin
#include <File.au3>
#include <String.au3>
#include <Inet.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>

Global $AppName = "Freeware list project"

Global $AppDestName = ""
Global $Data[1][5]
Global $Old_Sel_Index = 1
Global $Old_Srch_Input = ""
Global $Size = 0
Global $Old_Size = 0
Global $Old_Radio

$Form1 = GUICreate($AppName & " - Please wait...", 400, 460)
$ListView1 = GUICtrlCreateListView("Name|Section|Version|Description", 5, 5, 390, 200)
_GUICtrlListViewHideColumn($ListView1, 3)
$Button1 = GUICtrlCreateButton("Download", 5, 210, 100, 20)
$Button2 = GUICtrlCreateButton("Add Application", 110, 210, 100, 20)
GUICtrlSetState($Button2, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("", 5, 235, 390, 20, $SS_SUNKEN + $SS_CENTER)
$Edit1 = GUICtrlCreateEdit("", 5, 380, 390, 70, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY))
GUICtrlSetBkColor(-1, 0xffffff)

GUICtrlCreateLabel("Filter:", 5, 262)
$Search_Input = GUICtrlCreateInput("", 35, 260, 360, 20)

GUICtrlCreateGroup("Filter by...", 5, 290, 390, 70)
$Name_Radio = GUICtrlCreateRadio("Name", 20, 310)
$Old_Radio = $Name_Radio
GUICtrlSetState(-1, 1)

$Section_Radio = GUICtrlCreateRadio("Section", 260, 310)
$Version_Radio = GUICtrlCreateRadio("Version", 20, 330)
$Description_Radio = GUICtrlCreateRadio("Description", 260, 330)

GUISetState(@SW_SHOW)
GUISetState(@SW_DISABLE)

Global $Filter_Array = _GetApps()

$Form2 = GUICreate("Add Application", 200, 235, -1, -1, -1, $WS_EX_TOOLWINDOW, $Form1)
$Form2_Input1 = GUICtrlCreateInput("Name", 5, 5, 190, 20)
$Form2_Input2 = GUICtrlCreateInput("Download URL", 5, 30, 190, 20)
$Form2_Input3 = GUICtrlCreateInput("Section", 5, 55, 190, 20)
$Form2_Input4 = GUICtrlCreateInput("Version", 5, 80, 190, 20)
$Form2_Input5 = GUICtrlCreateEdit("Description", 5, 105, 190, 100)
$Form2_Button1 = GUICtrlCreateButton("Add Application", 5, 210, 190, 20)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
        Case $GUI_EVENT_CLOSE
            If $nMsg[1] = $Form1 Then
                Exit
            ElseIf $nMsg[1] = $Form2 Then
                GUISetState(@SW_ENABLE, $Form1)
                GUISetState(@SW_HIDE, $nMsg[1])
            EndIf
        Case $Name_Radio, $Section_Radio, $Version_Radio, $Description_Radio
            If $nMsg[0] <> $Old_Radio And GUICtrlRead($Search_Input) <> "" Then
                SortByFilterProc()
                $Old_Radio = $nMsg[0]
            EndIf
        Case $Button1
            If @InetGetActive Then ContinueLoop
            
            $URL = StringSplit($Data[_GUICtrlListViewGetSelectedIndices($ListView1)+2], "|")
            $URL = $URL[3]
            
            $Size = InetGetSize($URL)
            $AppDestName = StringRegExpReplace($URL, "^.*/", "")
            DirCreate(@ScriptDir & "\Temp")
            InetGet($URL, @ScriptDir & "\Temp\" & $AppDestName, 1, 1)
        Case $Button2
            GUISetState(@SW_DISABLE, $Form1)
            GUISetState(@SW_SHOW, $Form2)
        Case $Form2_Button1
            If GUICtrlRead($Form2_Input1) <> "" And GUICtrlRead($Form2_Input1) <> "Name" Then
                If GUICtrlRead($Form2_Input2) <> "" And GUICtrlRead($Form2_Input2) <> "Download URL" Then
                    If GUICtrlRead($Form2_Input3) <> "" And GUICtrlRead($Form2_Input3) <> "Section" Then
                        If GUICtrlRead($Form2_Input4) <> "" And GUICtrlRead($Form2_Input4) <> "Version" Then
                            If GUICtrlRead($Form2_Input5) <> "" And GUICtrlRead($Form2_Input5) <> "Description" Then
                            ;$Id = _CountRecords($Sql_Connection, "Software", "id")+1
                            ; _Query($Sql_Connection,"INSERT INTO Software VALUES (" & $Id & ",'" & GUICtrlRead($Form2_Input1) & "','" & GUICtrlRead($Form2_Input2) & "','" & GUICtrlRead($Form2_Input3) & "','" & GUICtrlRead($Form2_Input4) & "','" & GUICtrlRead($Form2_Input5) & "');")
                                GUICtrlSetData($Form2_Input1, "Name")
                                GUICtrlSetData($Form2_Input2, "Download URL")
                                GUICtrlSetData($Form2_Input3, "Section")
                                GUICtrlSetData($Form2_Input4, "Version")
                                GUICtrlSetData($Form2_Input5, "Description")
                                GUISetState(@SW_ENABLE, $Form1)
                                GUISetState(@SW_HIDE, $Form2)
                                _GUICtrlListViewDeleteAllItems($ListView1)
                            ;_GetApps()
                            EndIf
                        EndIf
                    EndIf
                EndIf
            EndIf
    EndSwitch
    If @InetGetActive Then
        $Cur_Size = Round(@InetGetBytesRead / 1024, 0)
        If $Cur_Size - 10 > $Old_Size Then; to avoid flikering
            GUICtrlSetData($Label1, "Downloading: " & $Cur_Size & "kB\" & Round($Size / 1024, 0) & "kB")
            $Old_Size = $Cur_Size
        EndIf
    ElseIf Not @InetGetActive And $AppDestName <> "" Then
        Run(@ScriptDir & "\Temp\" & $AppDestName)
        GUICtrlSetData($Label1, "Done!!!")
        $AppDestName = ""
    EndIf
    $Sel_Index = _GUICtrlListViewGetSelectedIndices($ListView1)
    If $Sel_Index <> $Old_Sel_Index And $Sel_Index <> -1 Then
        GUICtrlSetData($Edit1, $Filter_Array[$Sel_Index + 1][3])
        $Old_Sel_Index = $Sel_Index
    EndIf
    If GUICtrlRead($Search_Input) <> $Old_Srch_Input Then SortByFilterProc()
WEnd

Func SortByFilterProc()
    $Old_Srch_Input = GUICtrlRead($Search_Input)
    
    Local $IndexFilter = 0
    Local $iCount = 0
    
    For $i = $Name_Radio To $Description_Radio
        If GUICtrlRead($i) = 1 Then
            $IndexFilter = $iCount
            ExitLoop
        EndIf
        $iCount += 1
    Next
    If $Old_Srch_Input = "" Then
        _LV_Filter($ListView1, $Filter_Array, 1, -1)
    Else
        _LV_Filter($ListView1, $Filter_Array, $IndexFilter, $Old_Srch_Input)
    EndIf
EndFunc  ;==>SortByFilterProc

Func _LV_Filter($S_LV, ByRef $S_LV_Array2D, $LV_Collum_index, $LV_Search_String)
    If Not IsArray($S_LV_Array2D) Then Return
    _GUICtrlListViewDeleteAllItems($S_LV)
    For $x = 1 To UBound($S_LV_Array2D) - 1
        If StringInStr($S_LV_Array2D[$x][$LV_Collum_index], $LV_Search_String) And _
                $LV_Search_String <> "" And $LV_Search_String <> -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                If $S_LV_Array2D[$x][$y] <> "" Then $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
            GUICtrlCreateListViewItem($iData, $S_LV)
        ElseIf $LV_Search_String = -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                If $S_LV_Array2D[$x][$y] <> "" Then $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
            GUICtrlCreateListViewItem($iData, $S_LV)
        EndIf
    Next
;_GUICtrlListViewHideColumn($ListView1, 3)
EndFunc  ;==>_LV_Filter

Func _GetApps()
    $Data = _INetGetSource("http://alek900.itrello.com/autoit.php")
    $Data = _StringBetween($Data, "<xyz>", "</xyz>")
    
    $Data = StringReplace(StringReplace($Data[0], "</td><td>", "|"), "<td>", "")
    $Data = StringReplace(StringReplace($Data, "<tr>", Chr(1)), "</td>", "")
    $Data = StringReplace(StringReplace($Data, "<table border = 1>", ""), "</table>", "")
    $Data = StringSplit($Data, Chr(1))
    Local $Array[$Data[0] - 1][5]
    For $x = 2 To $Data[0]
        If $Data[$x] <> "" Then
            $Info = StringSplit($Data[$x], "|")
            If UBound($Info) >= 6 Then
                $Array[$x - 1][0] = $Info[2]
                $Array[$x - 1][1] = $Info[4]
                $Array[$x - 1][2] = $Info[5]
                $Array[$x - 1][3] = $Info[6]
                GUICtrlCreateListViewItem($Info[2] & "|" & $Info[4] & "|" & $Info[5] & "|" & $Info[6], $ListView1)
            EndIf
        EndIf
    Next
    WinSetTitle($Form1, "", $AppName)
    GUISetState(@SW_ENABLE, $Form1)
    Return $Array
EndFunc  ;==>_GetApps

Edit:

I don't know why, but AutoIt tags erase my post entirely :)

Edited by MsCreatoR

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

well i have bin trying to figure out how to use a php page to add a program to the list, this is what i have so far

PHP:

<?
$username="alek900";
$password="fallout2";
$database="autoit";

mysql_connect("SQL06.FREEMYSQL.NET",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$result = mysql_query("SELECT * FROM Software") or die(mysql_query());
$num=mysql_numrows($result);



if ($_GET["add"]="add")
{
    mysql_query("INSERT INTO Software VALUES ('"+$num+"','ds','ds','ds','ds','ds');");
    echo "<xyz>",$num,"</xyz>";
}elseif ($_GET["id"])
    {
    if ($_GET["Name"])
    {
        mysql_query("UPDATE Software SET name=",$_GET["Name"]," WHERE id=",$_GET["id"],";");
    }elseif ($_GET["Location"])
    {
        mysql_query("UPDATE Software SET location=",$_GET["Location"]," WHERE id=",$_GET["id"],";");
    }elseif ($_GET["Section"])
    {
        mysql_query("UPDATE Software SET Section=",$_GET["Section"]," WHERE id=",$_GET["id"],";");
    }elseif ($_GET["version"])
    {
        mysql_query("UPDATE Software SET version=",$_GET["Version"]," WHERE id=",$_GET["id"],";");
    }elseif ($_GET["desc"])
    {
        mysql_query("UPDATE Software SET description=",$_GET["Desc"]," WHERE id=",$_GET["id"],";");
    }
}
mysql_close();
?>

the script, has not bin updateed with the search function yet

#include <File.au3>
#include <String.au3>
#include <GUIConstants.au3>
#Include <GuiListView.au3>
#NoTrayIcon
;#RequireAdmin
Global $Data[1][5]

$Top = "Name|Version|Section|Description"
$Old_Sel_Index = 1
$Old_Srch_Input = ""
$Size = 0
$Old_Size = 0

DirCreate(@ScriptDir & "\Temp")
InetGet("http://alek900.itrello.com/autoit.php",@ScriptDir & "\Temp\apps.html",1)
$Data = FileRead(@ScriptDir & "\Temp\apps.html")
$Data = _StringBetween($Data,"<xyz>","</xyz>")

$Form1 = GUICreate("", 400, 460)
$ListView1 = GUICtrlCreateListView($Top, 5, 5, 490, 200)
_GUICtrlListViewHideColumn($ListView1, 3)
$Button1 = GUICtrlCreateButton("Download", 5, 210, 100, 20)
$Button2 = GUICtrlCreateButton("Add Application", 110, 210, 100, 20)

$Label1 = GUICtrlCreateLabel("", 5, 235, 390, 20, $SS_SUNKEN+$SS_CENTER)
$Edit1 = GUICtrlCreateEdit("", 5, 380, 390, 70, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlSetBkColor(-1, 0xffffff)

GUICtrlCreateLabel("Filter:", 5, 262)
$Search_Input = GUICtrlCreateInput("", 35, 260, 360, 20)

GUICtrlCreateGroup("Filter by...", 5, 290, 390, 70)
$Name_Radio = GUICtrlCreateRadio("Name", 20, 310)
$Old_Radio = $Name_Radio
GUICtrlSetState(-1, 1)

$Section_Radio = GUICtrlCreateRadio("Section", 260, 310)
$Version_Radio = GUICtrlCreateRadio("Version", 20, 330)
$Description_Radio = GUICtrlCreateRadio("Description", 260, 330)

GUISetState(@SW_SHOW)


Global $Filter_Array = _GetApps()

$Form2 = GUICreate("Add Application",200,235,-1,-1,-1,$WS_EX_TOOLWINDOW, $Form1)
$Form2_Input1 = GUICtrlCreateInput("Name",5,5,190,20)
$Form2_Input2 = GUICtrlCreateInput("Download URL",5,30,190,20)
$Form2_Input3 = GUICtrlCreateInput("Section",5,55,190,20)
$Form2_Input4 = GUICtrlCreateInput("Version",5,80,190,20)
$Form2_Input5 = GUICtrlCreateEdit("Description",5,105,190,100)
$Form2_Button1 = GUICtrlCreateButton("Add Application",5,210,190,20)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
        Case $GUI_EVENT_CLOSE
            If $nMsg[1] = $Form1 Then
                ExitLoop
            ElseIf $nMsg[1] = $Form2 Then
                GUISetState(@SW_ENABLE,$Form1)
                GUISetState(@SW_HIDE,$nMsg[1])
            EndIf
        Case $Name_Radio, $Section_Radio, $Version_Radio, $Description_Radio
            If $nMsg[0] <> $Old_Radio And GUICtrlRead($Search_Input) <> "" Then SortByFilterProc()
            $Old_Radio = $nMsg[0]
        Case $Button1
            If $Size = 0 Then
                FileDelete(@ScriptDir & "\Temp\Temp.exe")
                $URL = $Data[_GUICtrlListViewGetSelectedIndices($ListView1)+1][1]
                ;MsgBox(0,"",$URL) ;Debuging
                $Size = InetGetSize($URL)
                InetGet($URL,@ScriptDir & "\Temp\Temp.exe",1,1)
            EndIf
        Case $Button2
            GUISetState(@SW_DISABLE,$Form1)
            GUISetState(@SW_SHOW,$Form2)
        Case $Form2_Button1
            MsgBox(0,"","Test")
            If GUICtrlRead($Form2_Input1) <> "" And GUICtrlRead($Form2_Input1) <> "Name" Then
                If GUICtrlRead($Form2_Input2) <> "" And GUICtrlRead($Form2_Input2) <> "Download URL" Then
                    If GUICtrlRead($Form2_Input3) <> "" And GUICtrlRead($Form2_Input3) <> "Section" Then
                        If GUICtrlRead($Form2_Input4) <> "" And GUICtrlRead($Form2_Input4) <> "Version" Then
                            If GUICtrlRead($Form2_Input5) <> "" And GUICtrlRead($Form2_Input5) <> "Description" Then
                                $Name = GUICtrlRead($Form2_Input1)
                                $Down_url = GUICtrlRead($Form2_Input2)
                                $Section = GUICtrlRead($Form2_Input3)
                                $Version = GUICtrlRead($Form2_Input4)
                                $Description = GUICtrlRead($Form2_Input5)
                                InetGet("http://alek900.itrello.com/autoit2.php?add=add",@ScriptDir & "\Temp\Temp.html")
                                $ID = _StringBetween(FileRead(@ScriptDir & "\Temp\Temp.html"),"<xyz>","</xyz>")
                                MsgBox(0,"",$ID[0])
                                InetGet("http://alek900.itrello.com/autoit2.php?id=" & $ID[0] & "&Name=" & $Name)
                                InetGet("http://alek900.itrello.com/autoit2.php?id=" & $ID[0] & "&Location=" & $Down_url)
                                InetGet("http://alek900.itrello.com/autoit2.php?id=" & $ID[0] & "&Section=" & $Section)
                                InetGet("http://alek900.itrello.com/autoit2.php?id=" & $ID[0]  & "&version=" & $Version)
                                InetGet("http://alek900.itrello.com/autoit2.php?id=" & $ID[0]  & "&desc=" & $Description)
                                GUICtrlSetData($Form2_Input1,"Name")
                                GUICtrlSetData($Form2_Input2,"Download URL")
                                GUICtrlSetData($Form2_Input3,"Section")
                                GUICtrlSetData($Form2_Input4,"Version")
                                GUICtrlSetData($Form2_Input5,"Description")
                                GUISetState(@SW_ENABLE,$Form1)
                                GUISetState(@SW_HIDE,$Form2)
                                _GUICtrlListViewDeleteAllItems($ListView1)
                                ;_GetApps()
                            EndIf
                        EndIf
                    EndIf
                EndIf
            EndIf
    EndSwitch
    If @InetGetActive And $Size <> 0 Then
        $Cur_Size = Round(@InetGetBytesRead/1024,0)
        If $Cur_Size-10 > $Old_Size Then ; to avoid flikering
            GUICtrlSetData($Label1,"Downloading: " & $Cur_Size & "kB\" & Round($Size/1024,0) & "kB")
            $Old_Size = $Cur_Size
        EndIf
    ElseIf Not @InetGetActive And $Size <> 0 Then
        Run(@ScriptDir & "\Temp\Temp.exe")
        GUICtrlSetData($Label1,"Done!!!")
        $Size = 0
    EndIf
    $Sel_Index = _GUICtrlListViewGetSelectedIndices($ListView1)
    If  $Sel_Index <> $Old_Sel_Index And $Sel_Index <> -1 Then
        ;MsgBox(0,"",$Sel_Index & @CRLF & UBound($Filter_Array,1))
        GUICtrlSetData($Edit1,$Filter_Array[$Sel_Index+1][4])
        $Old_Sel_Index = $Sel_Index
    EndIf
    If GUICtrlRead($Search_Input) <> $Old_Srch_Input Then SortByFilterProc()
WEnd

Exit

Func SortByFilterProc()
    $Old_Srch_Input = GUICtrlRead($Search_Input)
    
    Local $IndexFilter = 0
    Local $iCount = 0
    
    For $i = $Name_Radio To $Description_Radio
        If GUICtrlRead($i) = 1 Then
            $IndexFilter = $iCount
            ExitLoop
        EndIf
    Next
    If $Old_Srch_Input = "" Then
        _LV_Filter($ListView1, $Filter_Array, 1, -1)
    Else
        _LV_Filter($ListView1, $Filter_Array, $IndexFilter, $Old_Srch_Input)
    EndIf
EndFunc

Func _LV_Filter($S_LV, ByRef $S_LV_Array2D, $LV_Collum_index, $LV_Search_String)
    If Not IsArray($S_LV_Array2D) Then Return
    _GUICtrlListViewDeleteAllItems($S_LV)
    For $x = 1 To UBound($S_LV_Array2D) - 1
        MsgBox(0,"",$S_LV_Array2D[$x][$LV_Collum_index])
        If StringInStr($S_LV_Array2D[$x][$LV_Collum_index], $LV_Search_String) And _
        $LV_Search_String <> "" And $LV_Search_String <> -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
            GUICtrlCreateListViewItem($iData, $S_LV)
        ElseIf $LV_Search_String = -1 Then
            Local $iData = ""
            For $y = 0 To UBound($S_LV_Array2D, 2) - 1
                If $y <> 3 And $S_LV_Array2D[$x][$y] <> "" Then $iData &= $S_LV_Array2D[$x][$y] & "|"
            Next
           If $iData <> "" then GUICtrlCreateListViewItem($iData, $S_LV)
        EndIf
    Next
    ;_GUICtrlListViewHideColumn($ListView1, 3)
EndFunc   ;==>_LV_Filter

Func _GetApps()
    $Data = StringReplace(StringReplace($Data[0],"</td><td>","|"),"<td>","")
    $Data = StringReplace(StringReplace($Data,"<tr>",Chr(1)),"</td>","")
    $Data = StringReplace(StringReplace($Data,"<table border = 1>",""),"</table>","")
    $Data = StringSplit($Data,Chr(1))
    Local $Array[$Data[0]-1][5]
    For $x = 2 To $Data[0]
        If $Data[$x] <> "" Then
            $Info = StringSplit($Data[$x],"|")
            If UBound($Info) >= 6 Then
                $Array[$x-1][0] = $Info[2]
                $Array[$x-1][1] = $Info[3]
                $Array[$x-1][2] = $Info[4]
                $Array[$x-1][3] = $Info[5]
                $Array[$x-1][4] = $Info[6]
                GUICtrlCreateListViewItem($Info[2] & "|" & $Info[4] & "|" & $Info[5] & "|" & $Info[6],$ListView1)
            EndIf
        EndIf
    Next
    Return $Array
EndFunc

[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

@JRSmile

i think sqlite is not the right database for you, i think you want to manage a database on the internet and therefore mysql is great, sqlite and msi are only for local databases on your own machine.

Sorry, But you don't know what you are talking about !!

SQLite is Natively supported in PHP, as are all other popular databases.

The one big advantage on this is that when using the SQLite in PHP, you don"t even need to install an (ODBC) driver.

And since PHP runs on Windows and Linux, you can have the complete world at your fingertips in no tilme.

regards

ptrex

Edited by ptrex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0