Phpbb2 Birthday Hack / Doğumgünü Modülü

+ Yorum Gönder
Webmaster ve Scriptler Bölümünden Phpbb2 Birthday Hack / Doğumgünü Modülü ile ilgili Kısaca Bilgi
  1. 1
    Small_Devil
    Özel Üye
    Reklam

    Phpbb2 Birthday Hack / Doğumgünü Modülü

    Reklam



    Phpbb2 Birthday Hack / Doğumgünü Modülü

    Forum Alev
    Kod:
     
    #
    #-----[ OPEN ]------------------------------------------------
    #
    portal.php
    #
    #-----[ FIND ]------------------------------------------------
    #
    //
    // Start output of page
    //
    #
    #-----[ BEFORE, ADD ]-----------------------------------------
    #
    // Start - Birthday on ezportal
    $sql = "SELECT user_id, username, user_birthday, user_level 
      FROM " . USERS_TABLE . " 
      WHERE user_birthday >= " . gmdate('md0000',time() + (3600 * $board_config['board_timezone'])) . " 
       AND user_birthday <= " . gmdate('md9999',time() + (3600 * $board_config['board_timezone']));
     if ( !($result = $db->sql_query($sql)) )
     {
      message_die(GENERAL_ERROR, 'Could not query members birthday information', '', __LINE__, __FILE__, $sql);
     }
     $user_birthdays = array();
     while ( $row = $db->sql_fetchrow($result) )
     {
      $bday_year = $row['user_birthday'] &#37; 10000;
      $age = ( $bday_year ) ? ' ('.(gmdate('Y')-$bday_year).')' : '';
      $color = '';
      if ( $row['user_level'] == ADMIN )
      {
       $color = ' style="color:#' . $theme['fontcolor3'] . '"';
      }
      else if ( $row['user_level'] == MOD )
      {
       $color = ' style="color:#' . $theme['fontcolor2'] . '"';
      }
      $user_birthdays[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $color . '>' . $row['username'] . '</a>' . $age;
     }
     $db->sql_freeresult($result);
     $birthdays = (!empty($user_birthdays)) ?
      sprintf($lang['Congratulations'],implode(', ',$user_birthdays)) :
      $lang['No_birthdays'];
     if ( $board_config['bday_lookahead'] != -1 )
     {
      $start = gmdate('md9999',strtotime('+'.$board_config['bday_lookahead'].' day') + (3600 * $board_config['board_timezone']));
      $end = gmdate('md0000',strtotime('+1 day') + (3600 * $board_config['board_timezone']));
      $operator = ($start > $end) ? 'AND' : 'OR';
      $sql = "SELECT user_id, username, user_birthday, user_level 
       FROM " . USERS_TABLE . " 
       WHERE (user_birthday <= $start 
        $operator user_birthday >= $end)
        AND user_birthday <> 0";
      if ( !($result = $db->sql_query($sql)) )
      {
       message_die(GENERAL_ERROR, 'Could not query upcoming birthday information', '', __LINE__, __FILE__, $sql);
      }
      $upcoming_birthdays = array();
      while ( $row = $db->sql_fetchrow($result) )
      {
       $bday_year = $row['user_birthday'] % 10000;
       $age = ( $bday_year ) ? ' ('.(gmdate('Y')-$bday_year).')' : '';
       $color = '';
       if ( $row['user_level'] == ADMIN )
       {
        $color = ' style="color:#' . $theme['fontcolor3'] . '"';
       }
       else if ( $row['user_level'] == MOD )
       {
        $color = ' style="color:#' . $theme['fontcolor2'] . '"';
       }
       $upcoming_birthdays[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $color . '>' . $row['username'] . '</a>' . $age;
      }
      $upcoming = (!empty($upcoming_birthdays)) ?
       sprintf($lang['Upcoming_birthdays'],$board_config['bday_lookahead'],implode(', ',$upcoming_birthdays)) :
       sprintf($lang['No_upcoming'],$board_config['bday_lookahead']);
     }
     if ( !empty($user_birthdays) || !empty($upcoming_birthdays) || $board_config['bday_show'] )
     {
      $template->assign_block_vars('birthdays',array());
      if ( !empty($upcoming_birthdays) || $board_config['bday_show'] )
      {
       $template->assign_block_vars('birthdays.upcoming',array());
      }
     }
    // End - Birthday on ezportal
    #
    #-----[ FIND ]------------------------------------------------
    #
     'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
    #
    #-----[ AFTER, ADD ]-----------------------------------------
    #
    // Start - Birthday on ezportal
     'BIRTHDAYS' => $birthdays,
     'UPCOMING' => $upcoming,
     'L_TODAYS_BIRTHDAYS' => $lang['Todays_Birthdays'],
     'L_VIEW_BIRTHDAYS' => $lang['View_Birthdays'],
    // End - Birthday on ezportal
    #
    #-----[ OPEN ]------------------------------------------------
    #
    # Make sure to edit this file for every theme you use!
    #
    templates/subSilver/portal_body.tpl
    #
    #-----[ FIND ]------------------------------------------------
    #
      </td>
         </tr>
        </table>
     
        <br />
    #
    #-----[ AFTER, ADD ]------------------------------------------
    #
    <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
         <tr>
       <td class="catHead" height="25"><span class="genmed"><b><font color="#ff0000">Birthdays</b></span></td>
         </tr>
         <tr>
       <td class="row1" align="left"><span class="gensmall">
       <br>{BIRTHDAYS}<br />{UPCOMING}
     
        <br />&nbsp;
       </span></td>
         </tr>
        </table>
     
        <br />
    #
    #-----[ EXAMPLE TPL ]------------------------------------------
    #
    <form method="post" action="{S_POLL_ACTION}">
       <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
        <tr>
      <td class="catHead" height="25"><span class="genmed"><b>{L_POLL}</b></span></td>
        </tr>
        <tr>
      <td class="row1" align="left">
       <div align="center" class="gensmall"><b>{S_POLL_QUESTION}</b></div><br />
       <!-- BEGIN poll_option_row -->
       <input type="radio" name="vote_id" value="{poll_option_row.OPTION_ID}" /><span class="gensmall">{poll_option_row.OPTION_TEXT}&nbsp;[{poll_option_row.VOTE_RESULT}]</span><br />
       <!-- END poll_option_row -->
       <br />
       <!-- BEGIN switch_user_logged_out -->
       <div align="center">{L_LOGIN_TO_VOTE}</div>
       <!-- END switch_user_logged_out -->
       <!-- BEGIN switch_user_logged_in -->
       <div align="center" class="gensmall"><input type="submit" class="mainoption" name="submit" value="{L_VOTE_BUTTON}" {DISABLED} /></div>
       <input type="hidden" name="topic_id" value="{S_TOPIC_ID}" />
       <input type="hidden" name="mode" value="vote" />
       <!-- END switch_user_logged_in -->
       <br />
      </td>
        </tr>
       </table>
       </form>
       <br />
       <table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
         <tr>
       <td class="catHead" height="25"><span class="genmed"><b><font color="#ff0000">Birthdays</b></span></td>
         </tr>
         <tr>
       <td class="row1" align="left"><span class="gensmall">
       <br>{BIRTHDAYS}<br />{UPCOMING}
     
        <br />&nbsp;
       </span></td>
         </tr>
        </table>
     
        <br />
    #
    #-----[ SAVE/CLOSE ALL FILES ]--------------------------------
    #
    Not: Değişiklikleri yapmadan &#246;nce dosyaların kopyasını alın...



  2. Alev
    Özel Üye

    Phpbb2 Birthday Hack / Doğumgünü Modülü Makalesine henüz yorum yazılmamış. ilk yorumu siz yapın


Sponsor Bağlantılar
+ Yorum Gönder
5 üzerinden 5.00 | Toplam : 1 kişi