1, Create /etc/ssh/login-notify.sh
with the following contents:
#!/bin/sh
# Change these two lines:
sender="[email protected]"
recepient="[email protected]"
if [ "$PAM_TYPE" != "close_session" ]; then
<?php | |
namespace Drupal\CUSTOM_MODULE\Plugin\WebformHandler; | |
use Drupal\Core\Config\ConfigFactoryInterface; | |
use Drupal\Core\Entity\EntityTypeManagerInterface; | |
use Drupal\Core\Form\FormStateInterface; | |
use Drupal\Core\Logger\LoggerChannelFactoryInterface; | |
use Drupal\Core\Url; | |
use Drupal\webform\Plugin\WebformHandlerBase; |
<?php | |
/** | |
* Convert BR tags to newlines and carriage returns. | |
* | |
* @param string $string | |
* The string to convert | |
* | |
* @return string | |
* The converted string |
<?php | |
$string = 'Text <img src="hello.png" > hello <img src="bye.png" /> other text.'; | |
$array = preg_split('/(<img[^>]+\>)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE); | |
// array(5) { | |
// [0]=> | |
// string(5) "Text " | |
// [1]=> |
<?php | |
$doc = new DOMDocument(); | |
$doc->loadHTML($html); | |
$xml = simplexml_import_dom($doc); | |
$images = $xml->xpath('//img'); | |
foreach ($images as $img) { |
<?php | |
$html = '<img border="0" src="/images/image1.jpg" alt="Image" width="100" height="100" /> | |
<img border="0" src="/images/image2.jpg" alt="Image" width="100" height="100" /> | |
<img border="0" src="/images/image3.jpg" alt="Image" width="100" height="100" />'; | |
preg_match_all('@src="([^"]+)"@', $html, $match); | |
$src = array_pop($match); |
<?php | |
/** | |
* Validation function for hungarian Social Security Number (TAJ). | |
* | |
* @param string $ssn | |
* The hungarian Social Security Number (TAJ). | |
* | |
* @return bool | |
* TRUE, if the number is valid. Otherwise FALSE. |
1, Create /etc/ssh/login-notify.sh
with the following contents:
#!/bin/sh
# Change these two lines:
sender="[email protected]"
recepient="[email protected]"
if [ "$PAM_TYPE" != "close_session" ]; then
<?php | |
namespace Drupal\[CUSTOM_MODULE]\Plugin\views\style; | |
use Drupal\[CUSTOM_MODULE]\Plugin\views\row\DateRecurCalendar as CalendarRowRecur; | |
use Drupal\calendar\CalendarDateInfo; | |
use Drupal\calendar\CalendarHelper; | |
use Drupal\calendar\CalendarStyleInfo; | |
use Drupal\views\Entity\View; | |
use Drupal\Core\Datetime\DateFormatter; |
<?php | |
namespace Drupal\[CUSTOM_MODULE]\Plugin\views\row; | |
use DateTimeZone; | |
use Drupal\calendar\CalendarEvent; | |
use Drupal\calendar\CalendarHelper; | |
use Drupal\calendar\CalendarViewsTrait; | |
use Drupal\Core\Datetime\DrupalDateTime; | |
use Drupal\Core\Entity\EntityFieldManagerInterface; |
Cron is a daemon that executes commands at specified intervals. These commands are called "cron jobs." Cron is available on Unix, Linux and Mac servers. Windows servers use a Scheduled Task to execute commands.
For a modest personal site, you might set up this cron job to run once a day. For a more active site, you might want to run that job more often - perhaps every few hours or every hour.
Each e107 version has a different URL, you must request for cron to trigger. For e107, the URL contains a token, which is a "secret key" to prevent external abuse.