xandeadx

North Mini Code (free)

Jun 25th, 2026 (edited)
53
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.43 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Drupal\date_display\Plugin\Block;
  4.  
  5. use Drupal\Core\Block\Attribute\Block;
  6. use Drupal\Core\Block\BlockBase;
  7. use Drupal\Core\Form\FormStateInterface;
  8. use Drupal\Core\StringTranslation\TranslatableMarkup;
  9. use Drupal\Core\DateTime\DateTimeFormatter;
  10.  
  11. /**
  12.  * Provides a Date Display block.
  13.  */
  14. #[Block(
  15.  id: "date_display",
  16.   admin_label: new TranslatableMarkup("Date Display"),
  17.   category: new TranslatableMarkup("Date"),
  18. )]
  19. class DateDisplayBlock extends BlockBase {
  20.  
  21.   /**
  22.    * {@inheritdoc}
  23.    */
  24.   public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  25.     $form = parent::buildConfigurationForm($form, $form_state);
  26.  
  27.     // Title setting
  28.     $form['title'] = [
  29.       '#type' => 'textfield',
  30.       '#title' => $this->t('Title'),
  31.       '#description' => $this->t('Optional title to display above the date'),
  32.       '#default_value' => $this->getSetting('title'),
  33.     ];
  34.  
  35.     // Date format setting
  36.     $form['format'] = [
  37.       '#type' => 'textfield',
  38.       '#title' => $this->t('Date format'),
  39.       '#description' => $this->t('Enter a date format string (see <a href="https://www.php.net/manual/en/datetime.format.php">PHP date format</a>). Default is F j, Y (e.g., March 1, 2024).'),
  40.       '#default_value' => $this->getSetting('format'),
  41.       '#placeholder' => $this->t('F j, Y'),
  42.     ];
  43.  
  44.     // Show full date setting
  45.     $form['show_full_date'] = [
  46.       '#type' => 'checkbox',
  47.       '#title' => $this->t('Show full date (customization)'),
  48.       '#description' => $this->t('When enabled, allows custom date customization for different display options'),
  49.       '#default_value' => $this->getSetting('show_full_date') ?? false,
  50.     ];
  51.  
  52.     return $form;
  53.   }
  54.  
  55.   /**
  56.    * {@inheritdoc}
  57.    */
  58.   public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  59.     parent::submitConfigurationForm($form, $form_state);
  60.     $values = $form_state->getValues();
  61.  
  62.     $this->configuration['title'] = $values['title'];
  63.     $this->configuration['format'] = $values['format'];
  64.     $this->configuration['show_full_date'] = $values['show_full_date'] ?? false;
  65.   }
  66.  
  67.   /**
  68.    * {@inheritdoc}
  69.    */
  70.   public function defaultConfiguration() {
  71.     return [
  72.       'title' => '',
  73.       'format' => 'F j, Y',
  74.       'show_full_date' => false,
  75.     ];
  76.   }
  77.  
  78.   /**
  79.    * {@inheritdoc}
  80.    */
  81.   public function build() {
  82.     $build = [];
  83.  
  84.     // Add title if configured
  85.     if (!empty($this->getSetting('title'))) {
  86.       $build['title'] = [
  87.         '#type' => 'html_tag',
  88.         '#tag' => 'h2',
  89.         '#attributes' => ['class' => ['date-display-title']],
  90.         '#value' => $this->getSetting('title'),
  91.       ];
  92.     }
  93.  
  94.     // Get current date
  95.     $dateTimeFormatter = $this->getDateFormatter();
  96.     $current_date = $dateTimeFormatter->format(time(), $this->getSetting('format'))
  97.       ?: $dateTimeFormatter->format(time(), 'F j, Y');
  98.  
  99.     // Add date display
  100.     $build['date'] = [
  101.       '#type' => 'markup',
  102.       '#markup' => '<div class="date-display-value">' . $current_date . '</div>',
  103.       '#allowed_tags' => ['div'],
  104.     ];
  105.  
  106.     // Add additional formatting options if enabled
  107.     if ($this->getSetting('show_full_date')) {
  108.       $build['additional_dates'] = [
  109.         '#type' => 'container',
  110.         '#attributes' => ['class' => ['date-display-additional']],
  111.         '#children' => [
  112.           $this->renderShortDate($dateTimeFormatter),
  113.           $this->renderLongDate($dateTimeFormatter),
  114.         ],
  115.       ];
  116.     }
  117.  
  118.     return $build;
  119.   }
  120.  
  121.   /**
  122.    * Render a short version of the date.
  123.    */
  124.   protected function renderShortDate(DateTimeFormatter $dateTimeFormatter) {
  125.     $short_format = 'M j, Y';
  126.     $current_date = $dateTimeFormatter->format(time(), $short_format);
  127.     return [
  128.       '#type' => 'html_tag',
  129.       '#tag' => 'span',
  130.       '#attributes' => ['class' => ['date-display-short']],
  131.       '#value' => $this->t('Short: @date', ['@date' => $current_date]),
  132.     ];
  133.   }
  134.  
  135.   /**
  136.    * Render a long version of the date.
  137.    */
  138.   protected function renderLongDate(DateTimeFormatter $dateTimeFormatter) {
  139.     $long_format = 'l, F j, Y - g:i A';
  140.     $current_date = $dateTimeFormatter->format(time(), $long_format);
  141.     return [
  142.       '#type' => 'html_tag',
  143.       '#tag' => 'span',
  144.       '#attributes' => ['class' => ['date-display-long']],
  145.       '#value' => $this->t('Full: @date', ['@date' => $current_date]),
  146.     ];
  147.   }
  148.  
  149. }
Advertisement
Comments
  • User was banned
  • User was banned
  • kenfewshus
    2 days
    # CSS 0.83 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://drive.google.com/file/d/1cvQPOZ7JecI0L6lqdIzIHJbHQBiDRT4U/view?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
Add Comment
Please, Sign In to add comment