The Main Window
|
|
The main window settings are in a file named GUISettings.INI. This file is in the GUI folder. Changing this file affects the main window. To see the changes restart your program. Below is a list of the properties and their meaning:
- [Program Settings]
- Name:
The name of your program.
- Title:
The title of your program, this title will show on the window caption.
- LogoPosition:
The background logo position:
0=Tile
1=Center
2=Stretch
- HaveSplash:
Determines if the program can show the splash screen:
0=False
1=True
- SplashTime:
Number of seconds until the splash screen Disappears.
- BackgroundColor:
The RGB color of the program background.
- HelpInTab:
Determines if the help file will show in a tab window or an external file.
0=False
1=True
- HelpFile:
If HelpInTab is false (no help in tab) then what file to execute on help
- [Toolbar Settings]
- Size:
The Width and Height of the toolbar buttons in pixels.
- Home_Tooltip:
The tooltip text for the Home Button
- Search_Tooltip:
The tooltip text for the Search Button
- Transfer_Tooltip:
The tooltip text for the Transfers Button
- Shared_Tooltip:
The tooltip text for the Shared Files Button
- Preference_Tooltip:
The tooltip text for the Preferences Button
- Help_Tooltip:
The tooltip text for the Help Button
- [Tab Settings]
- IsTab:
Determines if your program will work with Tabs or Buttons
1 = Tab Mode
0 = Buttons Mode
- FlatButton:
If in button mode, determines if the buttons are Flat or not.
0=False
1=True
- ShowIcons:
Determines if to show the icons on the Tabs/Buttons
0=Dont Show
1=Show
- Align:
Determines where the Tabs/Buttons are aligned (0 = Top, 1 = Bottom)
0=Top
1=Bottom
|
|
Toolbar Images
|
|
The toolbar images are located in the Toolbar folder. There are two bitmap images, one for the Enabled Buttons and the second for the Hot Buttons (when the mouse is over a button). Each image is a strip of button images where each button has the dimension determined by the Size Attribute in GUISettings.INI.
In the Paranoia Demo program the width and height of each button is 48 pixels.
The buttons order is as follows: Home, Search, Transfers, Shared Files, Preferences, and Help.
|
|
Tab Icons
|
|
|
The icons are located in the TabIcons folder. There are six icons, one for each tab/button. The name of the icon corresponds with the tab/button it is used for. The icons size should be 16x16 pixels.
|
|
Images
|
|
|
There are two important images in the Images folder. The first is the BackGroundLogo.bmp. This file is the image in the background of your program. The second is Splash.bmp which is the Splash screen image that your program shows when it loads (If you set this property in the GUISettings.INI file).
|
|
Application Icon
|
|
|
To change the application icon you only need to replace the icon in GUI\ApplicationIcon\application.ico with your new icon. This icon will show on the task bar, on your window and on the tray bar.
|
|
Internal GUI
|
|
The way to communicate with DIYP2P platform is by using a special Javascript function named "ExecuteCommand". This function is defined in the Common.js file. You can find all the Javascript functions in the /GUI/Templates/Javascript folder.
The Common.js file is the file that holds the basic functions DIYP2P uses - you shouldn't need to touch it, but you can if you really want :)
DIYP2P Graphic User Interface is divided into 5 screens; each screen has A corresponding HTML page and Javascript page with its own functions. In the following five sections I will describe each function syntax and usage.
>>About ExecuteCommand()
ExecuteCommand is the method by which you communicate with the platform. The first parameter is the Command Name. Each parameter is separated by a separator named "|SEPERATOR|" - Yes it's misspelled :)
If the command returns a value, it will return it either to a function you will specify or into the innerHTML property of a SPAN or a DIV - depending on the command itself. The innerHTML is the HTML between the start and end tags of the object. You can ofcourse use the innerText property which is the Text between the start and end tags of the object.
For example:
<SPAN ID=MyID>Hello World</SPAN>
alert(MyID.innerHTML); will show the "Hello World" text.
You must define the object in your HTML. For example, if you return a value to IsConnectedID object define it as follows:
<span ID="IsConnectedID" style="display: none;" >< /span>
|
|
Common Commands
|
|
>> ShowHome Command
Description: Tells the platform to open the Home Window.
Return Value:
None.
Syntax:
ExecuteCommand("ShowHome");
Command Name: ShowHome
|
>> ShowSearch Command
Description: Tells the platform to open a Search Window.
Return Value:
None.
Syntax:
ExecuteCommand("ShowSearch");
Command Name: ShowSearch
|
>> ShowTransfers Command
Description: Tells the platform to open the Transfers Window.
Return Value:
None.
Syntax:
ExecuteCommand("ShowTransfers");
Command Name: ShowTransfers
|
>> ShowShared Command
Description: Tells the platform to open the Shared Files Window.
Return Value:
None.
Syntax:
ExecuteCommand("ShowShared");
Command Name: ShowShared
|
>> ShowPreference Command
Description: Tells the platform to open the Preference Window.
Return Value:
None.
Syntax:
ExecuteCommand("ShowPreference");
Command Name: ShowPreference
|
>> ShowHelp Command
Description: Tells the platform to open the Help Window or File.
Return Value:
None.
Syntax:
ExecuteCommand("ShowHelp");
Command Name: ShowHelp
|
|
Home Screen
|
|
>> GetNetworkStatusFunction() Javascript Function
DIYP2P platform is calling this function every second. This function can be used to retrieve network status and to update the GUI.
|
>> IsConnected Command
Description: This command retrieves the connection status of both networks (G1/G2).
Return Values:
0 - One or both networks are connecting
1 - One or both networks are connected
2 - Both networks are disconnected
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("IsConnected|SEPERATOR|IsConnectedID");
Command Name: IsConnected
Return into Object: IsConnectedID
|
>> IsConnectedG1 Command
Description: This command retrieves the connection status of G1 network.
Return Values:
0 - connecting
1 - connected
2 - disconnected
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("IsConnectedG1|SEPERATOR|IsConnectedG1ID");
Command Name: IsConnectedG1
Return into Object: IsConnectedG1ID
|
>> IsConnectedG2 Command
Description: This command retrieves the connection status of G2 network.
Return Values:
0 - connecting
1 - connected
2 - disconnected
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("IsConnectedG1|SEPERATOR|IsConnectedG2ID");
Command Name: IsConnectedG2
Return into Object: IsConnectedG2ID
|
>> GetKnownNodes Command
Description: This command retrieves the list of nodes the client is trying to connect to.
Return Value:
List of IP addresses ordered by the Example HTML Template set by the command.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetKnownNodes|SEPERATOR|<NodeIP><br>|SEPERATOR|KnownNodesID");
Command Name: GetKnownNodes
Example HTML Template: "<NodeIP><br>" - <NodeIP> will be replaced with the real IP address.
Return into Object: KnownNodesID
|
>> GetCacheInfo Command
Description: This command retrieves information about the cached IPs (nodes).
Return Value:
If there are no IPs cached the number is 0% and if the number of IPs reached the max then its 100%.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetCacheInfo|SEPERATOR|CachedPercentID");
Command Name: GetCacheInfo
Return into Object: CachedPercentID
|
>> GetConnectedNodes Command
Description: This command retrieves the list of connected nodes - both for G1 and G2.
Return Value:
List of connected nodes (IP addresses) ordered by the Example HTML Template set by the command.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetConnectedNodes|SEPERATOR|<NodeIP><br>|SEPERATOR|ConnectedNodesID");
Command Name: GetConnectedNodes
Example HTML Template: "<NodeIP><br>" - <NodeIP> will be replaced with the connected IP address. <NodeID> will be replaced with the connected node ID. You can use the node ID to retrieve more info on it or to disconnect it.
Return into Object: ConnectedNodesID
|
>> GetConnectedG1Nodes Command
Description: This command retrieves the list of connected G1 nodes.
Return Value:
List of connected nodes (IP addresses) ordered by the Example HTML Template set by the command.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetConnectedG1Nodes|SEPERATOR|<NodeIP><br>|SEPERATOR|ConnectedG1NodesID");
Command Name: GetConnectedG1Nodes
Example HTML Template: "<NodeIP><br>" - <NodeIP> will be replaced with the connected IP address. <NodeID> will be replaced with the connected node ID. You can use the node ID to retrieve more info on it or to disconnect it.
Return into Object: ConnectedG1NodesID
|
>> GetConnectedG2Nodes Command
Description: This command retrieves the list of connected G2 nodes.
Return Value:
List of connected nodes (IP addresses) and nodes IDs (an identifier for a node) ordered by the Example HTML Template set by the command.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetConnectedG2Nodes|SEPERATOR|<NodeIP><br>|SEPERATOR|ConnectedG2NodesID");
Command Name: GetConnectedG1Nodes
Example HTML Template: "<NodeIP><br>" - <NodeIP> will be replaced with the connected IP address. <NodeID> will be replaced with the connected node ID. You can use the node ID to retrieve more info on it or to disconnect it.
Return into Object: ConnectedG2NodesID
|
>> DisconnectG1 Command
Description: Disconnect from the G1 network.
Return Value:
None.
Syntax:
ExecuteCommand("DisconnectG1");
Command Name: DisconnectG1
Return into Object: None
|
>> DisconnectG2 Command
Description: Disconnect from the G2 network.
Return Value:
None.
Syntax:
ExecuteCommand("DisconnectG2");
Command Name: DisconnectG2
Return into Object: None
|
>> ConnectG1 Command
Description: Connect to the G1 network.
Return Value:
None.
Syntax:
ExecuteCommand("ConnectG1");
Command Name: ConnectG1
Return into Object: None
|
>> ConnectG2 Command
Description: Connect to the G2 network.
Return Value:
None.
Syntax:
ExecuteCommand("ConnectG2");
Command Name: ConnectG2
Return into Object: None
|
>> RefreshCache Command
Description: This command call the GWebCache to get more nodes.
Return Value:
None.
Syntax:
ExecuteCommand("RefreshCache");
Command Name: RefreshCache
Return into Object: None
|
>> GetNodeInfo Command
Description: This command retrieves information about a node.
Return Value:
Returns extra information about a connected node. The available info is:
<IP> - The IP of the node, DIYP2P will replace <IP> with the real IP address.
<TimeConnected> - The time the connection was made, DIYP2P will replace <TimeConnected> with the time.
<BandWidth> - The bandwidth of the node, DIYP2P will replace <BandWidth> with real bandwidth data.
<Efficiency> - The efficiency of the node, DIYP2P will replace <Efficiency> with real efficiency data.
<Agent> - The node's agent, DIYP2P will replace <Agent> with agent name.
<Mode> - The mode of the node (Hub/Ultrapeer/etc), DIYP2P will replace <Mode> with node mode.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetNodeInfo|SEPERATOR|" + NodeID + "|SEPERATOR|" + Template + "|SEPERATOR|" + NodeInfoID);
Command Name: GetNodeInfo
Node ID: The ID of the node we wish to retrieve info on.
Example HTML Template: An HTML combined with the above available data. Each tag will be replaced by the node corresponding info.
Return into Object: NodeInfoID
|
>> RemoveNode Command
Description: This command disconnect a node.
Return Value:
None.
Syntax:
ExecuteCommand("RemoveNode|SEPERATOR|" + NodeID);
Command Name: RemoveNode
Node ID: The ID of the node we wish to remove.
Return into Object: None
|
>> ConnectNode Command
Description: This command connects to a specific node by its IP and port.
Return Value:
None.
Syntax:
ExecuteCommand("ConnectNode|SEPERATOR|" + IP + "|SEPERATOR|" + Port);
Command Name: ConnectNode
IP: The IP address of the node.
Port: The port of the node.
Return into Object: None
|
|
Search Screen
|
|
>> LoadFileTypes Command
Description: This command This command loads the file types list. If you want to search a file by its type (movie, image, application etc), use this function to load the list.
Return Value:
An array of file types strings and their corresponding IDs.
The list is returned into a function in the following format: String|SEPERATOR|ID.
See Paranoia "LoadFileTypesFunction" for an example.
Syntax:
ExecuteCommand("LoadFileTypes|SEPERATOR|LoadFileTypesFunction");
Command Name: LoadFileTypes
Return into function: LoadFileTypesFunction
|
>> SetSearchResultsHeaderTemplate Command
Description: This command defines the HTML header template of the results. When your program returns result, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the results are returned in the form of a table, where each result is another row in the table. The definition of the table header is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetSearchResultsHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='2px' cellspacing='0'>");
Command Name: SetSearchResultsHeaderTemplate
HTML Template: The HTML header of the results.
|
>> SetSearchResultsTemplate Command
Description: This command defines the HTML template of each result. When your program returns result, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the results are returned in the form of a table, where each result is another row in the table. The definition of the result row is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetSearchResultsTemplate|SEPERATOR|HTML Template");
Command Name: SetSearchResultsTemplate
HTML Template: Each of the following tags will be replaced by the specific result data:
<ResultID> - The ID of the result, can be used as a reference to the result itself.
<ResultName> - The name/title of the result (The file name).
<AverageSpeed> - Average download speed of the result.
<HostCount> - The number of hosts (peers) holding this file.
<SHA1> - The hash string of the result (SHA1 Hash).
Note: DIYP2P returns the template in lower case, so if you use a javascript function on the template, make sure its definition is lower case, or you will get a javascript error.
|
>> SetSearchResultsFooterTemplate Command
Description: This command defines the HTML footer template of the results. When your program returns result, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the results are returned in the form of a table, where each result is another row in the table. The definition of the table footer is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetSearchResultsFooterTemplate|SEPERATOR|</table>");
Command Name: SetSearchResultsFooterTemplate
HTML Template: The HTML footer of the results.
|
>> GetMetaAttributes Command
Description: Each file type has META attributes attached to it. For example Image file type has a width and height attribute. This function retrieves the META attributes for a file type.
Return Value:
An array of META attributes strings and their corresponding IDs.
The list is returned into a function in the following format: AttributeName|SEPERATOR|AttributeID.
See Paranoia "MetaAttributesFunction" for an example.
Syntax:
ExecuteCommand("GetMetaAttributes|SEPERATOR|" + File Type ID + "MetaAttributesFunction");
Command Name: GetMetaAttributes
File Type ID: The File Type ID that needs the attribute list.
Return into function: MetaAttributesFunction.
|
>> StartMETASearch Command
Description: This command performs the search using the search string and META data if specified.
Return Value:
Results corresponding to the search string and META data. The results are formatted using the HTML template set by SetSearchResultsHeaderTemplate, SetSearchResultsTemplate, SetSearchResultsFooterTemplate commands.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("StartMETASearch|SEPERATOR|" + Search String + "|SEPERATOR|" + File Type ID + "|SEPERATOR|" + Attributes + "|SEPERATOR|SearchResultsID");
Command Name: StartMETASearch
Search String: The search query.
File Type ID: The file type ID (movie, image, etc).
Attributes: The Meta data attributes concatenated as - Attribute:value. See Paranoia MetaAttributesFunction function for example.
Return into object: SearchResultsID.
|
>> StopSearch Command
Description: This command stops the search.
Return Value:
None.
Syntax:
ExecuteCommand("StopSearch");
|
>> GetMetaData Command
Description: This command retrieves any extra info (META data) about a result.
Return Value:
META data for a result.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetMetaData|SEPERATOR|" + Result ID + "|SEPERATOR|MetaID");
Command Name: GetMetaData
Result ID: The ID of the result we wish to retrieve the META data on.
Return into object: MetaID.
|
>> OnUpdate() Javascript function
Description: This Javascript function is called by the platform every time an update to the search results occur. You can use this function to update the GUI about the search progress.
|
>> GetProgress Command
Description: This command is used to retrieve the number of G2 nodes your query reached.
Return Value:
Number of G2 nodes.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetProgress|SEPERATOR|ProgressID");
Command Name: GetProgress
Return into object: ProgressID.
|
>> IsPaged Command
Description: This command is used to know if the results are divided into pages. If the number of results exceeded the limit defined in the program settings, then the rest of the results are in the next pages.
Return Value:
1 - The results are paged
0 - The results are not paged
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("IsPaged|SEPERATOR|IsPagedID");
Command Name: IsPaged
Return into object: IsPagedID.
|
>> GetStartingResultNumber Command
Description: This command retrieves the first result number on the page.
Return Value:
The first result number on the current page.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetStartingResultNumber|SEPERATOR|FirstResultNumberID");
Command Name: GetStartingResultNumber
Return into object: FirstResultNumberID.
|
>> GetEndingResultNumber Command
Description: This command retrieves the ending result number on the page.
Return Value:
The ending result number on the current page.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetEndingResultNumber|SEPERATOR|EndingResultNumberID");
Command Name: GetEndingResultNumber
Return into object: EndingResultNumberID.
|
>> GetTotalResultNumber Command
Description: This command retrieves the total results number.
Return Value:
The total results number.
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("GetTotalResultNumber|SEPERATOR|TotalResultNumberID");
Command Name: GetTotalResultNumber
Return into object: TotalResultNumberID.
|
>> GoToFirstPage Command
Description: Tells the platform to show results of the first page.
Return Value:
None.
Syntax:
ExecuteCommand("GoToFirstPage");
Command Name: GoToFirstPage
|
>> GoToNextPage Command
Description: Tells the platform to show results of the next page.
Return Value:
None.
Syntax:
ExecuteCommand("GoToNextPage");
Command Name: GoToNextPage
|
>> GoToPrevPage Command
Description: Tells the platform to show results of the previous page.
Return Value:
None.
Syntax:
ExecuteCommand("GoToPrevPage");
Command Name: GoToPrevPage
|
>> GoToLastPage Command
Description: Tells the platform to show results of the last page.
Return Value:
None.
Syntax:
ExecuteCommand("GoToLastPage");
Command Name: GoToLastPage
|
>> SortByName Command
Description: Sort results by file name.
Return Value:
None.
Syntax:
ExecuteCommand("SortByName");
Command Name: SortByName
|
>> SortBySize Command
Description: Sort results by file size.
Return Value:
None.
Syntax:
ExecuteCommand("SortBySize");
Command Name: SortBySize
|
>> SortByHostCount Command
Description: Sort results by number of hosts.
Return Value:
None.
Syntax:
ExecuteCommand("SortByHostCount");
Command Name: SortByHostCount
|
>> SortBySpeed Command
Description: Sort results by average speed.
Return Value:
None.
Syntax:
ExecuteCommand("SortBySpeed");
Command Name: SortBySpeed
|
>> DownloadFile Command
Description: This command tells the platform to start download the specific file.
Return Value:
None.
Syntax:
ExecuteCommand("DownloadFile|SEPERATOR|" + File ID);
Command Name: DownloadFile
File ID: The ID of the file to download
|
>> IsConnected Command
Description: This command is used to determine if the program is connected to one of the networks.
Return Value:
1 - Connected
0 - Not connected
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("IsConnected|SEPERATOR|IsConnectedID");
Command Name: IsConnected
Return into object: IsConnectedID.
|
|
Transfers Screen
|
|
>> ClearCompleted Command
Description: This command clears the completed downloads from the list.
Return Value:
None.
Syntax:
ExecuteCommand("ClearCompleted");
Command Name: ClearCompleted
|
>> ViewDownloads Command
Description: This command opens the downloads folder.
Return Value:
None.
Syntax:
ExecuteCommand("ViewDownloads");
Command Name: ViewDownloads
|
>> SetDownloadFilesHeaderTemplate Command
Description: This command defines the HTML header template of the downloaded files. When your program is showing the files being downloaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the downloaded files are returned in the form of a table, where each download is another row in the table. The definition of the table header is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetDownloadFilesHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='2px' cellspacing='0'>");
Command Name: SetDownloadFilesHeaderTemplate
HTML Template: The HTML header of the downloads.
|
>> SetCompletedDownloadFilesTemplate Command
Description: This command defines the HTML template of a completed download row in the download list. When your program is showing the files being downloaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the downloaded files are returned in the form of a table, where each download is another row in the table. The template definition of the completed file row is done with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetCompletedDownloadFilesTemplate|SEPERATOR|HTML Template");
Command Name: SetCompletedDownloadFilesTemplate
HTML Template: Each of the following tags will be replaced by the specific result data:
<DownloadID> - The ID of the download, can be used as a reference to the download itself.
<DownloadName> - The name/title of the download (The file name).
<DownloadSize> - The size of the file.
<DownloadComplete> - How much of the file was downloaded.
<DownloadStatus> - The status of the download.
<DownloadSpeed> - The speed of the download.
<DownloadETA> - The Estimated Time of Arrival for the download.
Note: DIYP2P returns the template in lower case, so if you use a javascript function on the template, make sure its definition is lower case, or you will get a javascript error.
|
>> SetIncompleteDownloadFilesTemplate Command
Description: This command defines the HTML template of a download in progress row in the download list. When your program is showing the files being downloaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the downloaded files are returned in the form of a table, where each download is another row in the table. The template definition of the download in progress row is done with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetIncompleteDownloadFilesTemplate|SEPERATOR|HTML Template");
Command Name: SetIncompleteDownloadFilesTemplate
HTML Template: Each of the following tags will be replaced by the specific result data:
<DownloadID> - The ID of the download, can be used as a reference to the download itself.
<DownloadName> - The name/title of the download (The file name).
<DownloadSize> - The size of the file.
<DownloadComplete> - How much of the file was downloaded.
<DownloadStatus> - The status of the download.
<DownloadSpeed> - The speed of the download.
<DownloadETA> - The Estimated Time of Arrival for the download.
Note: DIYP2P returns the template in lower case, so if you use a javascript function on the template, make sure its definition is lower case, or you will get a javascript error.
|
>> SetDownloadFilesFooterTemplate Command
Description: This command defines the HTML footer template of the downloaded files. When your program is showing the files being downloaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the downloaded files are returned in the form of a table, where each download is another row in the table. The definition of the table footer is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetDownloadFilesFooterTemplate|SEPERATOR|</table>");
Command Name: SetDownloadFilesFooterTemplate
HTML Template: The HTML footer of the downloads.
|
>> SetDownloadID Command
Description: This command sets the object name where the platform sends the HTML. The innerHTML property of this object will receive the list.
Return Value:
None.
Syntax:
ExecuteCommand("SetDownloadID|SEPERATOR|DownloadsID");
Command Name: SetDownloadID
Return into object: DownloadsID.
|
>> SetUploadFilesHeaderTemplate Command
Description: This command defines the HTML header template of the uploaded files. When your program is showing the files being uploaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the uploaded files are returned in the form of a table, where each download is another row in the table. The definition of the table header is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetUploadFilesHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='2px' cellspacing='0'>");
Command Name: SetUploadFilesHeaderTemplate
HTML Template: The HTML header of the uploads.
|
>> SetUploadFilesTemplate Command
Description: This command defines the HTML template of an upload row in the upload list. When your program is showing the files being uploaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the uploaded files are returned in the form of a table, where each upload is another row in the table. The template definition of an upload row is done with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetUploadFilesTemplate|SEPERATOR|HTML Template");
Command Name: SetUploadFilesTemplate
HTML Template: Each of the following tags will be replaced by the specific result data:
<UploadName> - The name/title of the upload (The file name).
<UploadBytesSent> - How many bytes where sent.
<UploadTime> - When the uploaded started.
<UploadStatus> - The status of the upload.
<UploadSpeed> - The speed of the upload.
<UploadEstimatedTime> - The Estimated Time of the upload.
Note: DIYP2P returns the template in lower case, so if you use a javascript function on the template, make sure its definition is lower case, or you will get a javascript error.
|
>> SetUploadFilesFooterTemplate Command
Description: This command defines the HTML footer template of the uploaded files. When your program is showing the files being uploaded, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the uploaded files are returned in the form of a table, where each upload is another row in the table. The definition of the table footer is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetUploadFilesFooterTemplate|SEPERATOR|</table>");
Command Name: SetUploadFilesFooterTemplate
HTML Template: The HTML footer of the downloads.
|
>> SetUploadID Command
Description: This command sets the object name where the platform sends the HTML. The innerHTML property of this object will receive the list.
Return Value:
None.
Syntax:
ExecuteCommand("SetUploadID|SEPERATOR|Uploads ID");
Command Name: SetUploadID
Return into object: UploadsID.
|
>> RunFile Command
Description: This command executes a file by its file ID.
Return Value:
None.
Syntax:
ExecuteCommand("RunFile|SEPERATOR|" + DownloadID);
Command Name: RunFile
Download ID: The ID of the File being downloaded.
|
>> RemoveDownload Command
Description: This command removes a download from the download list and deletes its corresponding fie.
Return Value:
None.
Syntax:
ExecuteCommand("RemoveDownload|SEPERATOR|" + Download ID);
Command Name: RemoveDownload
Download ID: The ID of the File being downloaded.
|
>> FindMoreSources Command
Description: This command searches for more hosts (peers) for the current download.
Return Value:
None.
Syntax:
ExecuteCommand("FindMoreSources|SEPERATOR|" + Download ID);
Command Name: FindMoreSources
Download ID: The ID of the File being downloaded.
|
>> StartDownload Command
Description: This command starts a download.
Return Value:
None.
Syntax:
ExecuteCommand("StartDownload|SEPERATOR|" + Download ID);
Command Name: StartDownload
Download ID: The ID of the File being downloaded.
|
>> PauseDownload Command
Description: This command pauses a download.
Return Value:
None.
Syntax:
ExecuteCommand("PauseDownload|SEPERATOR|" + Download ID);
Command Name: PauseDownload
Download ID: The ID of the File being downloaded.
|
>> IsStopped Command
Description: This command checks if a download is paused or not.
Return Value:
0 - not Paused
1 - Paused
Syntax:
ExecuteCommand("IsStopped|SEPERATOR|" + Download ID + "|SEPERATOR|IsStoppedID);
Command Name: IsStopped
Download ID: The ID of the File being downloaded.
Return into Object: IsStoppedID.
|
>> DownloadURI Command
Description: This command starts a download using a URI (Quick link/Hash Link).
Return Value:
None.
Syntax:
ExecuteCommand("DownloadURI|SEPERATOR|" + URI);
Command Name: DownloadURI
URI: URI String
|
>> GetDownloadETA Command
Description: This command gets the ETA value for a download.
Return Value:
String with the ETA of the download.
Syntax:
ExecuteCommand("GetDownloadETA|SEPERATOR|" + Download ID + "|SEPERATOR|DownloadETAID);
Command Name: GetDownloadETA
Download ID: The ID of the File being downloaded.
Return into Object: DownloadETAID.
|
>> GetDownloadSpeed Command
Description: This command gets the speed of a specific file download.
Return Value:
String with the speed of the download.
Syntax:
ExecuteCommand("GetDownloadSpeed|SEPERATOR|" + Download ID + "|SEPERATOR|DownloadSpeedID);
Command Name: GetDownloadSpeed
Download ID: The ID of the File being downloaded.
Return into Object: DownloadSpeedID.
|
>> GetDownloadCompleted Command
Description: This command gets how much of the file was downloaded.
Return Value:
How much of the file was downloaded.
Syntax:
ExecuteCommand("GetDownloadCompleted|SEPERATOR|" + Download ID + "|SEPERATOR|DownloadCompletedID);
Command Name: GetDownloadCompleted
Download ID: The ID of the File being downloaded.
Return into Object: DownloadCompletedID.
|
>> GetDownloadSize Command
Description: This command gets the size of the download.
Return Value:
String with the download file size.
Syntax:
ExecuteCommand("GetDownloadSize|SEPERATOR|" + Download ID + "|SEPERATOR|DownloadSizeID);
Command Name: GetDownloadSize
Download ID: The ID of the File being downloaded.
Return into Object: DownloadSizeID.
|
>> GetDownloadStatus Command
Description: This command gets the status of the download.
Return Value:
The download status.
Syntax:
ExecuteCommand("GetDownloadStatus|SEPERATOR|" + Download ID + "|SEPERATOR|DownloadStatusID);
Command Name: GetDownloadStatus
Download ID: The ID of the File being downloaded.
Return into Object: DownloadStatusID.
|
>> GetDownloadName Command
Description: This command gets download name.
Return Value:
String with the name of the file being downloaded.
Syntax:
ExecuteCommand("GetDownloadName|SEPERATOR|" + Download ID + "|SEPERATOR|DownloadNameID);
Command Name: GetDownloadName
Download ID: The ID of the File being downloaded.
Return into Object: DownloadNameID.
|
|
Shared Files Screen
|
|
>> OnUpdate() Javascript function
Description: This Javascript function is called by the platform every time an update to the shared files occur. You can use this function to update the GUI.
|
>> SetSharedFilesHeaderTemplate Command
Description: This command defines the HTML header template of the shared files. When your program is showing the shared files, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the shared files are returned in the form of a table, where each file is another row in the table. The definition of the table header is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetSharedFilesHeaderTemplate|SEPERATOR|<table width='100%' border='0' cellpadding='2px' cellspacing='0'>");
Command Name: SetSharedFilesHeaderTemplate
HTML Template: The HTML header of the uploads.
|
>> SetSharedFilesTemplate Command
Description: This command defines the HTML template of a shared file row in the download list. When your program is showing the shared files, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the shared files are returned in the form of a table, where each file is another row in the table. The template definition of the shared file row is done with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetSharedFilesTemplate|SEPERATOR|HTML Template");
Command Name: SetSharedFilesTemplate
HTML Template: Each of the following tags will be replaced by the specific result data:
<FileSize> - The size of the shared file.
<FileType> - The shared file type.
<FileSearhced> - The number of times the file was searched.
<FileUploaded> - The number of times the file was uploaded.
<FileHashed> - States if the file was hashed or not.
Note: DIYP2P returns the template in lower case, so if you use a javascript function on the template, make sure its definition is lower case, or you will get a javascript error.
|
>> SetSharedFilesFooterTemplate Command
Description: This command defines the HTML footer template of the shared files. When your program is showing the shared files, it uses a pre-defined HTML template to show it. For example in the Paranoia demo application, the shared files are returned in the form of a table, where each file is another row in the table. The definition of the table footer is with this command.
Return Value:
None.
Syntax:
ExecuteCommand("SetSharedFilesFooterTemplate|SEPERATOR|</table>");
Command Name: SetSharedFilesFooterTemplate
HTML Template: The HTML footer of the shared files.
|
>> LoadSharedList Command
Description: This command returns the shared files list as formated by the templates definitions.
Return Value:
The shared file list.
Syntax:
ExecuteCommand("LoadSharedList|SEPERATOR|SharedFilesID");
Command Name: LoadSharedList
Return into Object: SharedFilesID.
|
>> GetTotalFilesShared Command
Description: This command returns the total number of shared files.
Return Value:
The total number of shared files.
Syntax:
ExecuteCommand("GetTotalFilesShared|SEPERATOR|TotalFilesSharedID");
Command Name: GetTotalFilesShared
Return into Object: TotalFilesSharedID.
|
>> GetTotalSharedSize Command
Description: This command returns the total size of the shared files.
Return Value:
The total size of the shared files.
Syntax:
ExecuteCommand("GetTotalSharedSize|SEPERATOR|TotalSharedSizeID");
Command Name: GetTotalSharedSize
Return into Object: TotalSharedSizeID.
|
>> GetTotalSearched Command
Description: This command returns the total times the shared files were searched.
Return Value:
The total times the shared files were searched.
Syntax:
ExecuteCommand("GetTotalSearched|SEPERATOR|TotalFilesSharedID");
Command Name: GetTotalSearched
Return into Object: TotalSearchedID.
|
>> GetTotalUploaded Command
Description: This command returns the total number of files uploaded.
Return Value:
The total number of files uploaded.
Syntax:
ExecuteCommand("GetTotalUploaded|SEPERATOR|TotalUploadedID");
Command Name: GetTotalUploaded
Return into Object: TotalUploadedID.
|
>> IsPaged Command
Description: This command is used to know if the list is divided into pages. If the number of files exceeded the limit defined in the program settings, then the rest of the shared files are in the next pages.
Return Value:
1 - The list is paged
0 - The list isnt paged
The return value is set into the innerHTML property of a DIV or a SPAN tag.
Syntax:
ExecuteCommand("IsPaged|SEPERATOR|IsPagedID");
Command Name: IsPaged
Return into object: IsPagedID.
|
>> RunFile Command
Description: This command executes a file by its file ID.
Return Value:
None.
Syntax:
ExecuteCommand("RunFile|SEPERATOR|" + File ID);
Command Name: RunFile
Download ID: The ID of the File to run.
|
|
Building the installer
|
|
|
Now that the work is done and your new File Sharing program is ready, you need an easy to use installer to distribute your application. I recommend using the free open source NSIS installer. You can use Paranoia NSI file as a template.
|
|
|