Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Website Question  (Read 6928 times)

0 Members and 1 Guest are viewing this topic.

Ryan Schaffner

  • Anope User
  • Offline Offline
  • Posts: 11
Website Question
« 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.
Logged

Adam

  • Team
  • *
  • Offline Offline
  • Posts: 463
Re: Website Question
« Reply #1 on: February 19, 2012, 06:11:34 AM »

We use:

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

then just echo the file contents out.
Logged

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 240
    • French Eggdrop community
Re: Website Question
« Reply #2 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.

Dax Bane

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 30
  • Bane of All
Re: Website Question
« Reply #3 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)
Logged

CrazyCat

  • Anope User
  • Offline Offline
  • Posts: 240
    • French Eggdrop community
Re: Website Question
« Reply #4 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.

Ryan Schaffner

  • Anope User
  • Offline Offline
  • Posts: 11
Re: Website Question
« Reply #5 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.
Logged

Ryan Schaffner

  • Anope User
  • Offline Offline
  • Posts: 11
Re: Website Question
« Reply #6 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.
Logged
Pages: [1]   Go Up