Raised This Month: $ Target: $400
 0% 

read_file read all


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
urban_ninja
Senior Member
Join Date: Feb 2009
Old 03-28-2011 , 18:12   read_file read all
Reply With Quote #1

I'm trying to write a plugin that will read whole .txt files and all its contents and convert the .txt file content into .html or .htm for the web but my problem is read_file and write_file obligates you to specify a const text.
How do I set it so that it reads and write the whole line not just a specific position on the line?

Heres a general concept of what im trying to do:

Reads each line in a text file

filename.txt
Code:
Content line 1
Content line 2
Content line 3
Content line 4
...and so on down the lines
The takes what it got from the filename.txt and rewrites it into a web based (htm or html) file filename.htm

HTML Code:
</head>
<body bgcolor="#000000">
<p><font color="#d50000">Content line 1</font></p>
<p><font color="#d50000">Content line 2</font></p>
<p><font color="#d50000">Content line 3</font></p>
<p><font color="#d50000">Content line 4</font></p>
<p><font color="#d50000">...and so on down the lines</font></p></body></html>
The direct purpose behind this is to have an alternative to web base content from amx mod x with out the need to set up sql databases. Most game server providers offer a fast redirect service for fast DL straight from your local game server files and I want to use it to its full potential and have maybe web based ranking systems with out mysql databases of any sort. I already have added an .htm file is viewable in my browser and all I need is my amxx plugin to read stored content by other plugins and copy each line to a browsable .htm
__________________
urban_ninja is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-28-2011 , 18:40   Re: read_file read all
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=46218
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-28-2011 , 18:42   Re: read_file read all
Reply With Quote #3

It should be fairly simple. Write header content in .html file, read from txt file, format with HTML, write formated text to .html file, repeat, write footer html.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode