xandeadx

Qwen 3.7 Plus (paid)

Jun 26th, 2026
47
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.02 KB | None | 0 0
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. namespace Drupal\current_date_block\Plugin\Block;
  6.  
  7. use Drupal\Core\Block\Attribute\Block;
  8. use Drupal\Core\Block\BlockBase;
  9. use Drupal\Core\Form\FormStateInterface;
  10. use Drupal\Core\StringTranslation\TranslatableMarkup;
  11.  
  12. /**
  13.  * Provides a current date block with configurable format.
  14.  */
  15. #[Block(
  16.  id: 'current_date_block',
  17.   admin_label: new TranslatableMarkup('Current Date Block'),
  18.   category: new TranslatableMarkup('Custom'),
  19. )]
  20. final class CurrentDateBlock extends BlockBase {
  21.  
  22.   /**
  23.    * {@inheritdoc}
  24.    */
  25.   public function defaultConfiguration(): array {
  26.     return [
  27.       'block_label' => $this->t('Current Date'),
  28.       'date_format' => 'long',
  29.       'custom_date_format' => '',
  30.     ];
  31.   }
  32.  
  33.   /**
  34.    * {@inheritdoc}
  35.    */
  36.   public function blockForm($form, FormStateInterface $form_state): array {
  37.     $form['block_label'] = [
  38.       '#type' => 'textfield',
  39.       '#title' => $this->t('Block title'),
  40.       '#default_value' => $this->configuration['block_label'],
  41.       '#required' => TRUE,
  42.       '#description' => $this->t('The title displayed above the date.'),
  43.     ];
  44.  
  45.     $form['date_format'] = [
  46.       '#type' => 'select',
  47.       '#title' => $this->t('Date format'),
  48.       '#default_value' => $this->configuration['date_format'],
  49.       '#options' => [
  50.         'short' => $this->t('Short (e.g. @format)', ['@format' => date('m/d/Y')]),
  51.         'medium' => $this->t('Medium (e.g. @format)', ['@format' => date('D, m/d/Y')]),
  52.         'long' => $this->t('Long (e.g. @format)', ['@format' => date('l, F j, Y')]),
  53.         'custom' => $this->t('Custom'),
  54.       ],
  55.       '#description' => $this->t('Select a predefined date format or choose custom.'),
  56.     ];
  57.  
  58.     $form['custom_date_format'] = [
  59.       '#type' => 'textfield',
  60.       '#title' => $this->t('Custom date format'),
  61.       '#default_value' => $this->configuration['custom_date_format'],
  62.       '#description' => $this->t('A PHP date format string, e.g. <code>Y-m-d</code>, <code>d.m.Y H:i</code>. See <a href=":url">PHP date()</a> documentation.', [':url' => 'https://www.php.net/manual/datetime.format.php']),
  63.       '#states' => [
  64.         'visible' => [
  65.           ':input[name="settings[date_format]"]' => ['value' => 'custom'],
  66.         ],
  67.         'required' => [
  68.           ':input[name="settings[date_format]"]' => ['value' => 'custom'],
  69.         ],
  70.       ],
  71.     ];
  72.  
  73.     return $form;
  74.   }
  75.  
  76.   /**
  77.    * {@inheritdoc}
  78.    */
  79.   public function blockValidate($form, FormStateInterface $form_state): void {
  80.     if ($form_state->getValue('date_format') === 'custom') {
  81.       $custom_format = $form_state->getValue('custom_date_format');
  82.       if (empty($custom_format)) {
  83.         $form_state->setErrorByName('custom_date_format', $this->t('Custom date format is required when "Custom" is selected.'));
  84.       }
  85.     }
  86.   }
  87.  
  88.   /**
  89.    * {@inheritdoc}
  90.    */
  91.   public function blockSubmit($form, FormStateInterface $form_state): void {
  92.     $this->configuration['block_label'] = $form_state->getValue('block_label');
  93.     $this->configuration['date_format'] = $form_state->getValue('date_format');
  94.     $this->configuration['custom_date_format'] = $form_state->getValue('custom_date_format');
  95.   }
  96.  
  97.   /**
  98.    * {@inheritdoc}
  99.    */
  100.   public function build(): array {
  101.     $label = $this->configuration['block_label'];
  102.     $format_choice = $this->configuration['date_format'];
  103.  
  104.     $format_map = [
  105.       'short' => 'm/d/Y',
  106.       'medium' => 'D, m/d/Y',
  107.       'long' => 'l, F j, Y',
  108.     ];
  109.  
  110.     $php_format = $format_choice === 'custom'
  111.       ? $this->configuration['custom_date_format']
  112.       : ($format_map[$format_choice] ?? 'l, F j, Y');
  113.  
  114.     $current_date = \Drupal::service('date.formatter')->format(
  115.       \Drupal::time()->getRequestTime(),
  116.       'custom',
  117.       $php_format,
  118.     );
  119.  
  120.     return [
  121.       '#theme' => 'current_date_block',
  122.       '#label' => $label,
  123.       '#date' => $current_date,
  124.       '#cache' => [
  125.         'contexts' => ['timezone'],
  126.         'max-age' => 86400,
  127.       ],
  128.     ];
  129.   }
  130.  
  131. }
  132.  
Advertisement
Comments
  • User was banned
  • David6199
    2 days
    # CSS 0.82 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://drive.google.com/file/d/1cvQPOZ7JecI0L6lqdIzIHJbHQBiDRT4U/view
    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