Skip to content

Instantly share code, notes, and snippets.

<?php
class rmdir_recursive
{
private function rmdir($path) {
if (is_dir($path)) {
if ($handle = opendir($path)) {
while (false !== ($entry = readdir($handle))) {
if ($entry !== '.' && $entry !== '..' && !$this->rmdir($path . DIRECTORY_SEPARATOR . $entry)) {
return false;
}
@nao-pon
nao-pon / module_install_success.html
Created July 16, 2012 13:28
[XCL]モジュールインストール完了画面に該当モジュールの管理画面へのリンク追加
<div class="adminnavi">
<a href="./index.php"><{$smarty.const._MI_LEGACY_NAME}></a>
&raquo;&raquo; <a href="./index.php?action=ModuleList"><{$smarty.const._MI_LEGACY_MENU_MODULELIST}></a>
&raquo;&raquo; <a href="./index.php?action=InstallList"><{$smarty.const._AD_LEGACY_LANG_MODINSTALL}></a>
&raquo;&raquo; <span class="adminnaviTitle"><{$smarty.const._AD_LEGACY_LANG_MODINSTALL_SUCCESS}></span>
</div>
<h3 class="admintitle"><{$smarty.const._AD_LEGACY_LANG_MODINSTALL_SUCCESS}></h3>
<h4 class="admintitle"><{$smarty.const._AD_LEGACY_LANG_MODINSTALL_LOG}></h4>
@nao-pon
nao-pon / d3downloads_origin.php
Created July 3, 2012 05:44
d3download でオリジナルのテキストフィルターを使用可能にするテキストフィルター
<?php
define( '_MD_D3DOWNLOADS_FILTERS_ORIGIN_TITLE','Orignal filter' );
if ( ! function_exists('d3downloads_origin') ) {
function d3downloads_origin( $text, $html, $smiley, $xcode, $image, $br )
{
$myts =& MyTextSanitizer::getInstance();
return $myts->displayTarea( $text, $html, $smiley, $xcode, $image, $br );
}
@nao-pon
nao-pon / resource.db.php
Created June 26, 2012 01:15
hoge_fuga というテーマのテーマ下テンプレートがない場合、hoge_default のテーマ下テンプレを探す(有効スイッチ&優先順の指定可) resource.db.php
<?php
/*
* Smarty plugin
* -------------------------------------------------------------
* File: resource.db.php
* Type: resource
* Name: db
* Purpose: Fetches templates from a database
* Version: for XOOPS Cube Legacy 2.2
* Based on Hodajuku Distribution 1.04 resource.db.php
Index: html/modules/multiMenu/class/getMultiMenu.class.php
===================================================================
--- html/modules/multiMenu/class/getMultiMenu.class.php (revision 570)
+++ html/modules/multiMenu/class/getMultiMenu.class.php (working copy)
@@ -7,19 +7,34 @@
*/
class getMultiMenu {
var $block = array();
+
+ private $db;
<?php
/*
* 2011/09/09 16:45
* MultiMenu class function
* copyright(c) Yoshi Sakai at Bluemoon inc 2011
* GPL ver3.0 All right reserved.
*/
class getMultiMenu {
var $block = array();
<?php
if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
class phpQueryStringVulnerabilityHoneypot extends XCube_ActionFilter
{
function preBlockFilter() {
if (isset($_GET['-s'])) {
header('Content-type: text/plain');
exit('<?php
@nao-pon
nao-pon / gist:2650517
Created May 10, 2012 02:16
XOOPS protector ip ban
<?php
include './mainfile.php';
echo('XOOPS\'s Product Security team is seeking a passionate hacker. ');
$protectorTTL = 0;
if (XC_CLASS_EXISTS('Protector')) {
$protector =& Protector::getInstance();
$conf = $protector->getConf() ;
$can_ban = true;
if (is_object($xoopsUser)) {
$uid = $xoopsUser->getVar('uid') ;