phpBB Code Repository

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29220
Joined: Sat Aug 16, 2003 7:36 am

phpBB Code Repository

Post by Extensions Robot »

Modification name: phpBB Code Repository
Author: Desdenova
Modification 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.
Modification version: 1.0.6
Tested on phpBB version: 3.0.5

Download file: code_repository_1-0-6.zip
File size: 638.23 KiB

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Extension Customisations Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Mon Sep 19, 2022 7:33 pm, edited 11 times in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 18316
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

phpBB Code Repository

Post by DavidIQ »

Modification validated/released

Notes:
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
Desdenova
Registered User
Posts: 646
Joined: Sat Feb 23, 2008 7:25 pm

phpBB Code Repository

Post by Desdenova »

This post has been reserved for the MOD author.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: phpBB Code Repository

Post by 3Di »

Oky, what about a deepen description of what this MOD is about to do? :geek:

Many Thanks. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Desdenova
Registered User
Posts: 646
Joined: Sat Feb 23, 2008 7:25 pm

Re: phpBB Code Repository

Post by Desdenova »

The phpBB Code Repository is a on-server system for viewing and managing access to source files and/or pictures on the server, within a subdirectory of the phpBB installation.
You can manage access to the Code Repository, viewing files within it, viewing images within it, downloading the files, and allowing syntax highlighting of source files through a set of permissions that the MOD creates on installation.

Oh, did I forget to mention syntax highlighting? You can do that through this MOD, as it uses GeSHi to highlight source file code according to the file's mimetype (which, if unavailable, the MOD falls back to file extension to determine the language to highlight with).

Also included is caching integration for the crawldir engine, so that crawldir() is not repeatedly run on the server, preventing high server load.
Crawldir's construction is also non-recursive to allow a full scan of a directory's contents, along with any subdirectory's contents, along with any sub-subdirectory's contents..you get the picture. Using a recursive function instead of a loop to do something repeatedly would eventually result in a segmentation fault, as iWisdom found out with his IRC bot iWeather. :lol:

Since it's all managed within phpBB, also, you can control who can access it. If you want to release some source files to supporters, just set the supporters group to have permission to do so.
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: phpBB Code Repository

Post by 3Di »

Interesting. Thanks for all of your work on this.

Regards. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
UseLess
Registered User
Posts: 521
Joined: Mon Jul 22, 2002 7:26 pm
Location: North East UK

Re: phpBB Code Repository

Post by UseLess »

Greetings,

A note should be added that this mod requires php 5.

Try this:

Code: Select all

//		$i = 0;  //If anyone knows a way around having to use an incrementer in this, and it's just as effective, LET ME KNOW.
//		while(@sizeof($subdirs) > 0)
		foreach($subdirs as $i => $value)
		{
			$scan = scandir($subdirs[$i]);
			foreach($scan as $key => $item)
			{
				$filepath = $subdirs[$i] . '/' . $item;
				$relpath = substr($filepath, strlen($homepath));
				if($item == '.' || $item == '..' || $item == '.svn' || @is_link($filepath))
				{ 
					continue; 
				}
				if(is_dir($filepath))
				{
					if(in_array(($filepath), $ignore_dirs))
					{
						continue;
					}
					$subdirs[] = $filepath;
					$return['dirs'][] = $relpath;
					$return['subdirs'][$i + 1][] = $relpath;
				}
				else
				{
					if(in_array(($filepath), $ignore_files))
					{
						continue;
					}
					$return['files'][$i + 1][] = $relpath;
				}
			}
//			unset($subdirs[$i]);
//			$i++;
		}
Movie Quote:
It's not the years honey, it's the mileage...
phpBB 3 Mods @ phpBBStyles
Desdenova
Registered User
Posts: 646
Joined: Sat Feb 23, 2008 7:25 pm

Re: phpBB Code Repository

Post by Desdenova »

UseLess wrote:Greetings,

A note should be added that this mod requires php 5.

Try this:

Code: Select all

//		$i = 0;  //If anyone knows a way around having to use an incrementer in this, and it's just as effective, LET ME KNOW.
//		while(@sizeof($subdirs) > 0)
		foreach($subdirs as $i => $value)
		{
			$scan = scandir($subdirs[$i]);
			foreach($scan as $key => $item)
			{
				$filepath = $subdirs[$i] . '/' . $item;
				$relpath = substr($filepath, strlen($homepath));
				if($item == '.' || $item == '..' || $item == '.svn' || @is_link($filepath))
				{ 
					continue; 
				}
				if(is_dir($filepath))
				{
					if(in_array(($filepath), $ignore_dirs))
					{
						continue;
					}
					$subdirs[] = $filepath;
					$return['dirs'][] = $relpath;
					$return['subdirs'][$i + 1][] = $relpath;
				}
				else
				{
					if(in_array(($filepath), $ignore_files))
					{
						continue;
					}
					$return['files'][$i + 1][] = $relpath;
				}
			}
//			unset($subdirs[$i]);
//			$i++;
		}
I'm sorry, but this belief is incorrect. If you look at the file includes/crs/crs_misc_functions.php, you will see there is a PHP4 compatible scandir() alternative function defined for PHP4 usage.

Code: Select all

/**
* PHP4 Scandir alternative function, altered for phpBB MODDB specs
* Pulled from "Scandir for PHP4" blog post by Cory S.N. LaViska, at http://abeautifulsite.net/notebook/59 
* No context parameter, however.  Oh well...
*/
if(!function_exists('scandir')) 
{
    function scandir($directory, $sorting_order = 0)
    {
        $dh = opendir($directory);
        while(($filename = readdir($dh)) !== false)
        {
            $files[] = $filename;
        }
        if($sorting_order == 0)
        {
            sort($files);
        }
        else
        {
            rsort($files);
        }
        return($files);
    }
}
 
You probably didn't notice that compatibility function though, so no worries. ;)

As for the change in crawldir, I'll give that a look over and see if that would work within the function to produce the results needed. If so, you gets a cookie. :)
Mudjosh
Registered User
Posts: 234
Joined: Sat Jun 14, 2008 11:04 pm

Re: phpBB Code Repository

Post by Mudjosh »

I seem to be unable to click "Submit" in the ACP.. Or "Reset"

This poses a problem with the mod as I cannot activate it now.. I am 95% sure I installed it correctly.
Desdenova
Registered User
Posts: 646
Joined: Sat Feb 23, 2008 7:25 pm

Re: phpBB Code Repository

Post by Desdenova »

Mind posting the HTML source of the ACP module when you are viewing it, so I can track down the problem? :)
Mudjosh
Registered User
Posts: 234
Joined: Sat Jun 14, 2008 11:04 pm

Re: phpBB Code Repository

Post by Mudjosh »

of course.. I could prolly figure it out myself.. But I didn't know if this was a known issue.

Here it is.. To me it looks normal.. :?

I haven't installed a mod in phpbb3 in around half a year.. I have refreshed the cache on all my styles (Both Themes and Templates) Anywho.. So here you go:

Code: Select all

<!-- INCLUDE overall_header.html -->
<!-- IF S_VERSION_KEYWORD -->
<!--
/**
*
*===================================================================
*
*  phpBB Code Repository -- ACP Module Template File
*-------------------------------------------------------------------
*	Script info:
* Version:		1.0.6 - "Juno"
* Copyright:	(c) 2008, 2009 | Obsidian -- Infinityhouse Creations
* License:		http://opensource.org/licenses/gpl-license.php  |  GNU Public License v2
* Package:		ACP
*
*===================================================================
*
*/
//-->
<!-- ENDIF -->

<a name="maincontent"></a>

<h1>{L_ACP_CRS_MAIN_SETTINGS}</h1>

<p>{L_ACP_CRS_MAIN_SETTINGS_EXPLAIN}</p>

<!-- IF S_ERROR -->
	<div class="errorbox">
		<h3>{L_WARNING}</h3>
		<p>{ERROR_MSG}</p>
	</div>
<!-- ENDIF -->

	<form id="acp_crs_main" method="post" action="{U_ACTION}">

		<!-- IF S_IN_VERSION_CHECK -->

			<!-- IF not UP_TO_DATE -->
				<div class="errorbox">
					<h3>{L_UPDATE_AVAILABLE}</h3>
					<p>{UPDATE_INSTRUCTIONS}</p>
				</div>
			<!-- ELSE -->
				<div class="successbox">
					<p>{L_CRS_IS_UP_TO_DATE}</p>
				</div>
			<!-- ENDIF -->

			<fieldset>
				<legend>{L_VERSION_CHECK}</legend>

				<dl>
					<dt><label>{L_CURRENT_CRS_VERSION}</label></dt>
					<dd><strong>{CURRENT_VERSION}</strong></dd>
				</dl>

				<dl>
					<dt><label>{L_REMOTE_CRS_VERSION}</label></dt>
					<dd><strong>{LATEST_VERSION}</strong></dd>
				</dl>

		<!-- ELSE -->
		
		<fieldset>
			<legend>{L_VERSION_CHECK}</legend>

			<dl>
				<dt><label>{L_CURRENT_CRS_VERSION}</label></dt>
				<dd><strong>{CRS_VERSION}</strong></dd>
			</dl>
		
		<!-- ENDIF -->

			<dl>
				<dt><label for="checkversion">{L_CHECK_FOR_UPDATES}</label></dt>
				<dd><input class="button2" type="submit" id="checkversion" name="checkversion" value="{L_RUN}" /></dd>
			</dl>
		</fieldset>
	

	<!-- IF S_FOUNDER -->
	<fieldset>
		<legend>{L_CRS_RECACHE}</legend>
		<form id="action_purge_crs_cache_form" method="post" action="{U_ACTION}">
			<dl>
				<dt><label for="recache">{L_CRS_RECACHE_FILES}</label></dt>
				<dd><input class="button2" type="submit" id="recache" name="recache" value="{L_RUN}" /></dd>
			</dl>
		</form>
	</fieldset>
	<!-- ENDIF -->

		<fieldset>
			<legend>{L_GENERAL_OPTIONS}</legend>
			<dl>
				<dt><label for="crs_source_path">{L_CRS_SOURCE_PATH}:</label><br /><span>{L_CRS_SOURCE_PATH_EXPLAIN}</span></dt>
				<dd><input id="crs_source_path" name="crs_source_path" value="{CRS_SOURCE_PATH}" type="text" maxlength="255" /></dd>
			</dl>

			<dl>
				<dt><label for="crs_enabled">{L_CRS_ENABLED}:</label><br /><span>{L_CRS_ENABLED_EXPLAIN}</span></dt>
				<dd><label><input type="radio" class="radio" id="crs_enabled" name="crs_enabled" value="1"<!-- IF CRS_ENABLED--> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
					<label><input type="radio" class="radio" name="crs_enabled" value="0"<!-- IF not CRS_ENABLED --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
			</dl>

			<dl>
				<dt><label for="crs_dump_geshi_css">{L_CRS_DUMP_GESHI_CSS}:</label><br /><span>{L_CRS_DUMP_GESHI_CSS_EXPLAIN}</span></dt>
				<dd><label><input type="radio" class="radio" id="crs_dump_geshi_css" name="crs_dump_geshi_css" value="1"<!-- IF CRS_DUMP_GESHI_CSS --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
					<label><input type="radio" class="radio" name="crs_dump_geshi_css" value="0"<!-- IF not CRS_DUMP_GESHI_CSS --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
			</dl>
		</fieldset>


		<fieldset class="submit-buttons">
			<legend>{L_SUBMIT}</legend>
			<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
			<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
			{S_FORM_TOKEN}
		</fieldset>
	</form>

<!-- INCLUDE overall_footer.html -->
Mudjosh
Registered User
Posts: 234
Joined: Sat Jun 14, 2008 11:04 pm

Re: phpBB Code Repository

Post by Mudjosh »

Nevermind. In firefox it worked. In Safari and IE it didn't.. 8-)
Desdenova
Registered User
Posts: 646
Joined: Sat Feb 23, 2008 7:25 pm

Re: phpBB Code Repository

Post by Desdenova »

That's odd. :shock:

Also, for the HTML...I mean the output, when you're viewing the page. Not the template file. :lol:
Mudjosh
Registered User
Posts: 234
Joined: Sat Jun 14, 2008 11:04 pm

Re: phpBB Code Repository

Post by Mudjosh »

oh oops..

It might have just been an issue of needing a ton of page refreshes.. I remember a mod needing a lot of page refreshes before it shown up in the acp.. Maybe it was something similar.. anywho, it works well of course. :P

I would like to make only one suggestion though..

Is there anyway at all that you could add in a way to search within the Code Repository too. I know that after a mod is validated mod authors do not like to add features.. but just in case.. :P
Desdenova
Registered User
Posts: 646
Joined: Sat Feb 23, 2008 7:25 pm

Re: phpBB Code Repository

Post by Desdenova »

What kind of search would you be talking about?

If it is in-file search, that can't happen. It would be too strenuous on the server to do something like that...GeSHi for a large file is bad enough as it is, crawldir() on a very deep set of directories is even worse.


However, I was thinking of building a jumpbox of directories indexed as a possible feature...would that be something similar to what you are referring to?
Locked

Return to “[3.0.x] MOD Database Releases”