Anope IRC Services

Anope.org => Anope General => Topic started by: Ryan Schaffner on February 19, 2012, 06:08:50 AM

Title: Website Question
Post by: Ryan Schaffner on February 19, 2012, 06:08:50 AM
I have a question for whoever created the Modules site.  I am working on a similar project and for the life of me cannot find a solution similar to what I need, but you have achieved it.  I need to load a plain text file to display in the browser and have it (the browser) obey the line feeds.

Here is the example of what you have.
http://modules.anope.org/index.php?page=browser&id=229&release=2.3.1&name=ns_fidentify.cpp&v=45

I notice not <pre> tags or anything keeping the formatting.

Could someone please let me know how you achieved this.

Thanks.
Title: Re: Website Question
Post by: Adam on February 19, 2012, 06:11:34 AM
We use:

header("Content-Type: text/plain");

then just echo the file contents out.
Title: Re: Website Question
Post by: CrazyCat on February 19, 2012, 08:51:16 AM
I've a small question about the modules part too. I'm trying to do a similar library (for eggdrops scripts), but before redo any existing system, I want to know if it's possible to get the one you create.

And if yes, where can I get it ?

Thanks by advance.
Title: Re: Website Question
Post by: Dax Bane on February 19, 2012, 08:54:17 AM
It is likely they've coded it from ground-up; while I don't know the system it is plausable that they're using a database backend to hold not only the modules themselves (that is, the source code to 'em) but also the metadata related thereto (name, author, category/ies, etc)
Title: Re: Website Question
Post by: CrazyCat on February 19, 2012, 09:22:59 AM
I know "how it's done", and I've started doing the same, but I haven't a lot of time free and the anope system is really complete, so if they accept to share the sources to me, I can adapt it for my use and send back some evolutions I've to add.
If not, I'll continue on develop my own system.

Regards.
Title: Re: Website Question
Post by: Ryan Schaffner on February 19, 2012, 03:48:02 PM
I have tried Every "Content-type: text/plain" including adding charset.  It just does not work on my servers.  So how exactly are you echoing the file, because i have tried every print/echo/include statement php has, and it sill comes out as a non-breaking single line.
Title: Re: Website Question
Post by: Ryan Schaffner on February 19, 2012, 04:03:50 PM
Ahh.  Found my issue.  For some reason when using
Quote
<?php header("Content-Type: text/plain");?><?php ---
it ignores the content type.  But keeping it all in one <?php tag works.  Thanks for the help.