Announcement

Collapse
No announcement yet.

This day in History??

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #61
    Try this code:

    Code:
    ob_start();
    global $db, $vbulletin;
    $show_count = 10;
    $query = sprintf("SELECT * FROM " . TABLE_PREFIX . "event
        WHERE visible = 1
        AND (
           (MONTH(FROM_UNIXTIME(dateline_from)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_from)) = DAY(NOW()))
           OR
           (MONTH(FROM_UNIXTIME(dateline_to)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_to)) = DAY(NOW()))
        )
        ORDER BY dateline_from ASC LIMIT $show_count");
    $event_get = vB::$db->query_read($query);
    $output_bits = "";
    while ($event = vB::$db->fetch_array($event_get)) {
        if ($event["dateline_to"] == 0) {
            $format = sprintf(
                "On %s",
                vbdate(
                    "D M jS Y",
                    $event["dateline_from"],
                    false,
                    true,
                    false,
                    true
                )
            );
        } else {
            $format = sprintf(
                "From %s to %s",
                vbdate(
                    "D M jS Y",
                    $event["dateline_from"],
                    false,
                    true,
                    false,
                    true
                ),
                vbdate("jS M Y", $event["dateline_to"], false, true, false, true)
            );
        }
        $output_bits .= sprintf("
            <div class='noavatarcontent floatcontainer widget_post_bit'>
                <div class='widget_post_userinfo'></div>
                <div class='smallavatartext widget_post_comment_noavatar'>
                    <h5 class='widget_post_header'>
                        <a href='calendar.php?do=getinfo&e=%d' class='title'>%s</a>
                    </h5>
                    <div class='meta'>%s</div>
                </div>
            </div>",
            $event["eventid"],
            $event["title"],
            $format
        );
    }
    $output = $output_bits;
    ob_end_clean();​
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #62
      Originally posted by glennrocksvb View Post
      Try this code:

      Code:
      ob_start();
      global $db, $vbulletin;
      $show_count = 10;
      $query = sprintf("SELECT * FROM " . TABLE_PREFIX . "event
      WHERE visible = 1
      AND (
      (MONTH(FROM_UNIXTIME(dateline_from)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_from)) = DAY(NOW()))
      OR
      (MONTH(FROM_UNIXTIME(dateline_to)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateline_to)) = DAY(NOW()))
      )
      ORDER BY dateline_from ASC LIMIT $show_count");
      $event_get = vB::$db->query_read($query);
      $output_bits = "";
      while ($event = vB::$db->fetch_array($event_get)) {
      if ($event["dateline_to"] == 0) {
      $format = sprintf(
      "On %s",
      vbdate(
      "D M jS Y",
      $event["dateline_from"],
      false,
      true,
      false,
      true
      )
      );
      } else {
      $format = sprintf(
      "From %s to %s",
      vbdate(
      "D M jS Y",
      $event["dateline_from"],
      false,
      true,
      false,
      true
      ),
      vbdate("jS M Y", $event["dateline_to"], false, true, false, true)
      );
      }
      $output_bits .= sprintf("
      <div class='noavatarcontent floatcontainer widget_post_bit'>
      <div class='widget_post_userinfo'></div>
      <div class='smallavatartext widget_post_comment_noavatar'>
      <h5 class='widget_post_header'>
      <a href='calendar.php?do=getinfo&e=%d' class='title'>%s</a>
      </h5>
      <div class='meta'>%s</div>
      </div>
      </div>",
      $event["eventid"],
      $event["title"],
      $format
      );
      }
      $output = $output_bits;
      ob_end_clean();​
      thats better, but its missing the posters avatar and the posted by

      Lars Ulrich Opens Up on How Metallica Has Changed: 'Sometimes, We May Have Gone Too F

      Posted By google (0 replies)
      Today, 02:13 AM in NewsBot​ <<<< missing

      and avatar

      Comment


        #63
        That's all what I can do for now. It will require more time and knowledge for me to find out how to display more information about an event. Know that I have more experience coding for vB5 and not vB4.
        Helpful? Donate. Thanks!
        Buy me a coffeePayPal QR Code
        Fast VPS Host for vBulletin:
        A2 Hosting & IONOS

        Comment


          #64
          Thanks for all your help!
          I'll tip ya once I clear up this doctor bill.

          Comment

          Users Viewing This Page

          Collapse

          There is 1 user viewing this forum topic.

          • Guest Guest

          Latest Posts

          Collapse

          Working...
          X
          Searching...Please wait.
          An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

          Please push the back button and reload the previous window.'
          An unexpected error was returned: 'Your submission could not be processed because the token has expired.

          Please push the back button and reload the previous window.'
          An internal error has occurred and the module cannot be displayed.
          There are no results that meet this criteria.
          Search Result for "|||"