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 | |
class Sentence | |
{ | |
public function getWordsFromString($sentence) | |
{ | |
$words = explode(' ', $sentence); | |
foreach ($words as $k => $word) { | |
$words[$k] = new Word($word); // I want this to not be hardcoded, but injected | |
} |
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: 2Checkout Payment Gateway | |
Plugin URI: | |
Description: Allows you to use 2Checkout payment gateway with the WooCommerce plugin. | |
Version: 0.0.1 | |
Author: Craig Christenson | |
Author URI: https://www.2checkout.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 | |
/** | |
* This file is the main Package Manager. | |
* | |
* Simple Machines Forum (SMF) | |
* | |
* @package SMF | |
* @author Simple Machines http://www.simplemachines.org | |
* @copyright 2014 Simple Machines and individual contributors |
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
function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flexible_start = false, $show_prevnext = true) | |
{ | |
global $modSettings, $context, $txt, $smcFunc; | |
// Save whether $start was less than 0 or not. | |
$start = (int) $start; | |
$start_invalid = $start < 0; | |
// Make sure $start is a proper variable - not less than 0. | |
if ($start_invalid) |
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 | |
/** | |
* Proof of concept for per-post roles and capabilities | |
* | |
* The meta is stored for a page under _post_capabilities postmeta as an array having -> | |
* [<user_id>] => array( | |
* 'user_id' => ID of the user | |
* 'role' => <name of the role> | |
* 'capabilities' => (array) <list of custom capabilities an admin might want to assign> |
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 | |
/** | |
* Proof of concept for per-forum moderation | |
* | |
* Place this under wp-content/plugins/poc, activate it via Plugins section of WP Admin | |
* Add a row in postmeta table having the post_id of the forum you want to assign the moderator(s) to, | |
* meta_key as "_bbp_forum_moderators" and a comma separated list of the user's IDs you want | |
* to make moderators for the said forum | |
* |
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 | |
if (!defined('BASEPATH')) | |
exit('No direct script access allowed'); | |
/* | |
* LimeSurvey (tm) | |
* Copyright (C) 2011 The LimeSurvey Project Team / Carsten Schmitz | |
* All rights reserved. | |
* License: GNU/GPL License v2 or later, see LICENSE.php | |
* LimeSurvey is free software. This version may have been modified pursuant |