[MODDB] phpBB Code Repository 1.0.x "Juno"

Post your MODs, receive and provide feedback!
Topics in this forum are not for MOD support, they are for giving the author feedback.
Forum rules
The topics in this forum are not for general MOD support, they are for giving the MOD author some feedback, ideas and bug reports.
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

[MODDB] phpBB Code Repository 1.0.x "Juno"

Post by Obsidian »

phpBB Code Repository
[img]http://fail.infinityhouse.org/images/crs.png[/img]

Description - A Code Repository MOD, it allows the viewing of source code/images in the source file directory, and also offers syntax highlighting of the source VIA GeSHi.

Author notes - Be sure to allow read access to the source file directory, along with keeping a file in the directory at all times for the server's sake.

Install length - Roughly under five minutes, with an easy install (only six edits)

Version - 1.0.6
phpBB Version - phpBB 3.0.5
Development stage - Public Release Cycle

Format - MODX

Download
  • code_repository_1-0-6.zip
    ZIP Archive
    (638.23 KiB) Downloaded 371 times
  • [url=http://www.phpbb.com/mods/db/index.php?i=misc&mode=display&contrib_id=10605]MODDB Page[/url]

Credits -
  • House, for patiently helping me de-nub this.
  • Self, for writing the thing.
  • eviL<3 for his Pastebin MOD that I ripped the phpBB-and-GeSHi integration from.
  • BenBE for building GeSHi. It's one /heck/ of a beautiful system in action.


Suggestions welcome...
Last edited by Obsidian on 10 May 2009, 00:08, edited 13 times in total.
User avatar
Semi_Deus
Past Contributor
Past Contributor
Posts: 405
Joined: 28 Sep 2007, 23:52
Location: the Netherlands
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Semi_Deus »

@todo: Make demo!

This sounds great. If I am correct, it makes it possible for guests and everyone else (except bots) to view the websites code?

I tried making something like this allooong time ago.
I called it phpBB Base. It was a website where you could view all phpBB files, and the code would be syntax highlighted by GeSHi too.

But as I have a lack of phpBB knowledge..I didn't get around finishing it, etc etc.
Igor will remember it, don't you igor?

so as I was saying: Excited to see a demo ;)
Image
Keep an eye on us, were back in business..
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Semi_Deus wrote:@todo: Make demo!


>.> A demo? Oh noez.. /kicks House to let me at epic_fail()'s FTP backend

I might be able to PM you a link to it later on, once I update the 0.5.0 version on my old online Dev'ment board.

Semi_Deus wrote:This sounds great. If I am correct, it makes it possible for guests and everyone else (except bots) to view the websites code?

I tried making something like this allooong time ago.
I called it phpBB Base. It was a website where you could view all phpBB files, and the code would be syntax highlighted by GeSHi too.


Erm...not /exactly/, but close. Yes, guests and members can view all the source contents that CRS picks up (and yes, no bots are allowed to view in order to be kind to the server. Besides, do /YoU\ want Google getting your code?). However, anything that's put into the folder specified by (Class) phpbb_crs's site_source_path() method is detected and shown in the repository...except for an .htaccess document in the root of the source directory (which blocks direct access to files, but not images).

Essentially, you /could/ hook it up to the forum's root path, but the question is, would you want to? It'd have to be filtered quite heavily in order to be secure.
Or, you could just copy over the entire thing (except for the cache, avatar, and temp files) into the source/ directory, and that's it.

One question, did your setup cache the filelist? Mine does for 3 days, to ease up that heavy strain from running crawldir(). O.o;

--Oh, by the way, I have finally verified that the auto-generated MD5sum for the file being viewed is correct, and changes with the file's contents.
User avatar
Semi_Deus
Past Contributor
Past Contributor
Posts: 405
Joined: 28 Sep 2007, 23:52
Location: the Netherlands
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Semi_Deus »

No no, I guess phpBB Base was different then.
phpBB Base was for regular users, to view the core phpBB files.
Of course, unused ones, for it to be secure.
So when people didn't have a backup of standard stuff, or they needed to check something out.
They could just look up the file at phpBB Base.

but anyways, back on topic, your mod sounds great, keep up teh good work :)
Image
Keep an eye on us, were back in business..
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Well, it /can/ be used for it, you just have to alter it the right way. ;)

Anyways, House was crabbing at me for having a messy structure...anyone else think this? O_o;;
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Okies, Semi_Deus, you want a demo?

You want a DEMO?

DO YOOOOOU~~

Here it be. :D http://fail.infinityhouse.org/code.php
User avatar
Semi_Deus
Past Contributor
Past Contributor
Posts: 405
Joined: 28 Sep 2007, 23:52
Location: the Netherlands
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Semi_Deus »

Cool :D
Now, can I add some feedback?
Maybe it is best to have the result somewhere near the top.
Or to remove the list, if you have come to your final destination.
Because else you would have to scroll a long way down to see it.
Example: http://fail.infinityhouse.org/code.php? ... ew&d=5&f=0
(and the image isn't showing :geek: :mrgreen: )
Image
Keep an eye on us, were back in business..
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Hrm...yeah, I know. I can always just force it in the view mode not to show directories, just recode it so that it's view-file only.

You might want to repost that link, I just rebuilt the cache of the filelist, so that link's aiming at the wrong thing. (Something I'm considering for 1.1.x, a special static link for certain files..SQL based, and requiring perms to set a static link.)

Image not showing? ARRRRGH... T_T

Not again...stupid .htaccess. *fails yet again*
I think I know how to fix it though...looks like there /will/ be an RC3 after all.
stef775
New member
New member
Posts: 2
Joined: 05 Jan 2009, 19:59

Re: [RC2] phpBB-CRS (Code Repository System)

Post by stef775 »

Liked your idea but change the .htaccess to:

Code: Select all

<Files "*">
order allow,deny
deny from all
</Files>


<Files ~ "\.(gif|jpe?g|png)$">
order allow,deny
allow from all
</Files>
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Thanks for the suggestion, however I'm not going to implement it, as I think I'm going to pipe the images through a PHP file instead (similar to download/file.php) so that people don't know /where/ your source files are hidden. ;)

Also, I'm considering moving the entire source/ directory to within store/, so that the .htaccess file in store/ also covers the source/ directory, and makes the phpBB root directory a little less cramped directory-wise.
stef775
New member
New member
Posts: 2
Joined: 05 Jan 2009, 19:59

Re: [RC2] phpBB-CRS (Code Repository System)

Post by stef775 »

That's ok for me, I don't like this idea either. You can't set permissions on it and that kind of crap.

Never thought to put it in a table. You don't have the load then and people can not find your files.
User avatar
drathbun
Member
Member
Posts: 156
Joined: 26 Jul 2006, 00:02
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by drathbun »

I read the description several times, but I'm not sure I get it. What would you use this for?
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Essentially, you can put PHP files (or others) in the source/ directory, and it displays the file's source code. Good for if you're coding and want people to see snapshots of the work in development, and SVN would be overkill since it's only you messing with the files.

I use it on my dev.Board to hold the source files of my MODs as I work on them, so I can refer other people to the files if I ever need help, or for distributing the MOD without packaging it (my quick MODs that I do, I don't package up and make pretty).
JimA
New member
New member
Posts: 21
Joined: 17 Nov 2008, 09:59
Real name: Jim

Re: [RC2] phpBB-CRS (Code Repository System)

Post by JimA »

Can you also make it private? That only members of a certain group are able to view the source of the files?
User avatar
Obsidian
Supporter
Supporter
Posts: 736
Joined: 13 May 2008, 15:20
Real name: Damian
Contact:

Re: [RC2] phpBB-CRS (Code Repository System)

Post by Obsidian »

Hrm...I can, yes. I think I will, too, for RC3. I'll have it install some auths for it. I'm thinking this:
  • Can view CRS
  • Can use GeSHi highlighting
  • Can download CRS files
Having only the founder being able to rebuild the CRS filelist's cache file will stay the same regardless.

Also, a bit of a bug found in RC2!
It's constantly recaching the crawldir results, which means it is constantly running crawldir...hehe...oops. [img]http://fail.infinityhouse.org/images/smilies/light_et_al/aiwebs_019.gif[/img]
A fix has been implemented in the now-in-development RC3 release.

To fix for yourself, look at includes/functions_crs.php, line 157, should be.
This is the line you are looking for:

Code: Select all

if (($filelist = $cache->get('_crs_files')) !== false)


What's wrong is that I used a !==, it should have been ===. Just replace the previous line mentioned with this line to fix..

Code: Select all

if (($filelist = $cache->get('_crs_files')) === false)


The caching method should work now. I myself replaced the entire method with the RC3 version of it, as it is a smarter and more logical layout of code, but it isn't necessary.
Post Reply