This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
class UserInfo extends Concrete5_Model_UserInfo { | |
public static function getByValidationHash($uHash, $unredeemedHashesOnly = true, $passtimestamp = 604800) { | |
$uDateGenerated = time() - $passtimestamp; | |
$db = Loader::db(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$holidays = array('08-13', '08-14', '08-15'); // 休日の定義 | |
$weekend = array('Sun', 'Sat'); // 土日の定義 | |
$date = new DateTime(); // 現在時刻の取得 | |
$dateList = array(); // 日付を格納する空の配列を定義 | |
$i = 0; | |
while ($i < 7) { // 直近7日間を取得 | |
$date->add(DateInterval::createFromDateString('1 day')); // 1日送る |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
// Formブロックをロード | |
Loader::block('form'); | |
// ヘルパーのロード | |
$valn = Loader::helper('validation/numbers'); | |
// フォームの結果を見れる権限があるかのチェック |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add below codes into config/site.php | |
// If User is logged in | |
if (isset($_SESSION['uID']) && $_SESSION['uID'] > 0 && isset($_SESSION['uName']) && $_SESSION['uName'] != '') { | |
define('BASE_URL', 'https://example.com'); | |
} else { | |
define('BASE_URL', 'http://example.com'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Really Simple CSV Importer add-on: Comma | |
Version: 0.1 | |
*/ | |
class rscsvimporter_comma { | |
// singleton instance | |
private static $instance; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// config/site_post.php | |
defined('C5_EXECUTE') or die("Access Denied."); | |
$req = Request::get(); | |
$reqPath = $req->getRequestPath(); | |
if ( strpos($reqPath, 'en/') !== false ) { | |
Localization::changeLocale('en_US'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('C5_EXECUTE') or die("Access Denied."); | |
$navItems = $controller->getNavItems(); | |
?> | |
<div class="menu"> | |
<?php | |
// サブメニューが開いているかどうかのフラグ | |
$subMenuIsOpen = false; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('C5_EXECUTE') or die("Access Denied."); | |
$navItems = $controller->getNavItems(true); | |
echo '<ul class="clearfix">'; //opens the top-level menu | |
foreach ($navItems as $ni) { | |
echo '<li>'; //opens a nav item | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// application/config/app.php | |
return array( | |
'aliases' => array( | |
'GlobalArea' => '\Application\Src\Area\GlobalArea' | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Original: http://jonathannicol.com/blog/2013/11/19/automated-git-deployments-from-bitbucket/ | |
$repo_dir = '/home/<username>/<repo-name>.git'; | |
$web_root_dir = '/home/<username>/public_html'; | |
// Full path to git binary is required if git is not in your PHP user's path. Otherwise just use 'git'. | |
$git_bin_path = 'git'; | |
$update = false; |