| Mirage Source http://miragesource.net/forums/ |
|
| News System (Pulled from URL) http://miragesource.net/forums/viewtopic.php?f=210&t=409 |
Page 1 of 1 |
| Author: | Matt [ Mon Aug 21, 2006 3:46 pm ] |
| Post subject: | News System (Pulled from URL) |
Okay, this is a simple tut. Very simple actually. First off.. Open up your client source. Add the component.. Code: Microsoft Internet Transfer Control 6.0 Now, place that component (INet) on frmMainMenu.. Name it.. Code: InetNews Now, if you wish to use colors, images, and such in your news box, add a rich text box (I won't go into explanation for adding images/color), otherwise, add a normal text box. Name it.. Code: txtNews Add this sub, if you don't already have it, if you do, just add the code inside this sub.. Code: Private Sub Form_Load()
Dim TmpStr As String TmpStr = InetNews.OpenURL("http://tpo.phpnet.us/News.txt") txtNews.Text = TmpStr End Sub I left my test url in there, just replace it with the url you will use. And that's it. It will now pull the text from the text file in the url. Enjoy! Later, I will write one to pull the news from the game's server, which also, isn't hard. Hope this helps someone. |
|
| Author: | Leighland [ Thu Aug 24, 2006 5:48 pm ] |
| Post subject: | |
Wow, this is so much easier than my system lol... at the current point in time , due to my newb programming skills and lack of ability to think, my game only displays the news once you log in to the game. This should come in handy.. thanks EDIT: Works, thanks a lot. |
|
| Author: | map210690 [ Mon Aug 28, 2006 11:10 am ] |
| Post subject: | |
just asking, but in a way couldnt you use that for accounts ect ? on a site ? all you would have to do is on server figure out away of sending via ftp. or if ur sever is the site host should be even simpler lol. |
|
| Author: | Coke [ Mon Aug 28, 2006 11:33 am ] |
| Post subject: | |
Its called a mysql database, and theres a link to mse running from one somewhere on this site =P |
|
| Author: | jsventor [ Fri Sep 14, 2007 7:26 pm ] |
| Post subject: | Re: News System (Pulled from URL) |
how can I make the inetNews use a url from an ini file? |
|
| Author: | Matt [ Fri Sep 14, 2007 8:04 pm ] |
| Post subject: | Re: News System (Pulled from URL) |
Add the getvar and putvar subs to your source and use that. url = getvar((app.path & "whatever.ini"), "NEWS", "URL") Or something like that. Doesn't much make a difference. |
|
| Author: | jsventor [ Fri Sep 14, 2007 11:10 pm ] |
| Post subject: | Re: News System (Pulled from URL) |
I have Code: Dim TmpStr As String Dim URLPath as string URLPath = GetVar(App.Path & "\Config\News.ini", "NEWS", "PATH") URLPath = InetNews.OpenURL txtNews.Text = URLPath Doesent work though |
|
| Author: | Rian [ Tue Sep 25, 2007 9:46 pm ] |
| Post subject: | Re: News System (Pulled from URL) |
Not tested, but I think it will work... Code: Private Sub Form_Load()
Dim TmpStr As String Dim UrlPath As String UrlParth = GetVar(App.Path & "\Config\News.ini", "NEWS", "PATH") TmpStr = InetNews.OpenURL("UrlPath") txtNews.Text = TmpStr End Sub |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|