Thread: Birthday
View Single Post
  #1  
Old 6th February 2010, 16:22
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default Birthday
allow a birthday list on index
Just a little something I threw together for me on monday
open database and add
Code:
ALTER TABLE `torrent_users`  ADD `birthday` varchar(20) character set utf8 collate utf8_bin default NULL,
Now open user/editprofile.php and find
PHP Code:
        if (!isset($jabber) OR $jabber == ""$jabber "NULL";
        
processinput("jabber",$jabber); 
and add after
PHP Code:
        if ($bday_day =='--' OR $bday_month == "--" OR $bday_year == "--"$birthday "NULL";
        else
        
$birthday $bday_day.'-'.$bday_month.'-'.$bday_year;
        
processinput("birthday",$birthday); 
Now find
PHP Code:
if ($user->moderator)echo "<tr><td><p>Seedbox</p></td><td><p><input type=\"text\" name=\"seedbox\" value=\"".long2ip($userrow["seedbox"])."\" size =\"40\" /></p></td></tr>\n"
and add after
PHP Code:
//Birthday Modd
        
if(isset($userrow["birthday"]) OR !$userrow["birthday"]=='')$bday explode("-"$userrow["birthday"]);
        else
        
$bday = array('0','0','0');
        
$now getdate(time() - date('Z'));
echo 
"<tr><td><p>";
help(pic("help.gif"),"Setting a year will list your age when it is your birthday.","BirthDay");
echo
"BirthDay:</p></td>
<td><p><span class=\"genmed\">Day:</span> 
<select name=\"bday_day\">
<option "
.(($bday['0'] == 0)? "selected=\"selected\"" '')." value=\"0\">--</option>
<option "
.(($bday['0'] == 1)? "selected=\"selected\"" '')." value=\"1\">1</option>
<option "
.(($bday['0'] == 2)? "selected=\"selected\"" '')." value=\"2\">2</option>
<option "
.(($bday['0'] == 3)? "selected=\"selected\"" '')." value=\"3\">3</option>
<option "
.(($bday['0'] == 4)? "selected=\"selected\"" '')." value=\"4\">4</option>
<option "
.(($bday['0'] == 5)? "selected=\"selected\"" '')." value=\"5\">5</option>
<option "
.(($bday['0'] == 6)? "selected=\"selected\"" '')." value=\"6\">6</option>
<option "
.(($bday['0'] == 7)? "selected=\"selected\"" '')." value=\"7\">7</option>
<option "
.(($bday['0'] == 8)? "selected=\"selected\"" '')." value=\"8\">8</option>
<option "
.(($bday['0'] == 9)? "selected=\"selected\"" '')." value=\"9\">9</option>
<option "
.(($bday['0'] == 10)? "selected=\"selected\"" '')." value=\"10\">10</option>
<option "
.(($bday['0'] == 11)? "selected=\"selected\"" '')." value=\"11\">11</option>
<option "
.(($bday['0'] == 12)? "selected=\"selected\"" '')." value=\"12\">12</option>
<option "
.(($bday['0'] == 13)? "selected=\"selected\"" '')." value=\"13\">13</option>
<option "
.(($bday['0'] == 14)? "selected=\"selected\"" '')." value=\"14\">14</option>
<option "
.(($bday['0'] == 15)? "selected=\"selected\"" '')." value=\"15\">15</option>
<option "
.(($bday['0'] == 16)? "selected=\"selected\"" '')." value=\"16\">16</option>
<option "
.(($bday['0'] == 17)? "selected=\"selected\"" '')." value=\"17\">17</option>
<option "
.(($bday['0'] == 18)? "selected=\"selected\"" '')." value=\"18\">18</option>
<option "
.(($bday['0'] == 19)? "selected=\"selected\"" '')." value=\"19\">19</option>
<option "
.(($bday['0'] == 20)? "selected=\"selected\"" '')." value=\"20\">20</option>
<option "
.(($bday['0'] == 21)? "selected=\"selected\"" '')." value=\"21\">21</option>
<option "
.(($bday['0'] == 22)? "selected=\"selected\"" '')." value=\"22\">22</option>
<option "
.(($bday['0'] == 23)? "selected=\"selected\"" '')." value=\"23\">23</option>
<option "
.(($bday['0'] == 24)? "selected=\"selected\"" '')." value=\"24\">24</option>
<option "
.(($bday['0'] == 25)? "selected=\"selected\"" '')." value=\"25\">25</option>
<option "
.(($bday['0'] == 26)? "selected=\"selected\"" '')." value=\"26\">26</option>
<option "
.(($bday['0'] == 27)? "selected=\"selected\"" '')." value=\"27\">27</option>
<option "
.(($bday['0'] == 28)? "selected=\"selected\"" '')." value=\"28\">28</option>
<option "
.(($bday['0'] == 29)? "selected=\"selected\"" '')." value=\"29\">29</option>
<option "
.(($bday['0'] == 30)? "selected=\"selected\"" '')." value=\"30\">30</option>
<option "
.(($bday['0'] == 31)? "selected=\"selected\"" '')." value=\"31\">31</option>
</select> 
<span class=\"genmed\">Month:</span> 
<select name=\"bday_month\">
<option value=\"0\">--</option>
<option "
.(($bday['1'] == 1)? "selected=\"selected\"" '')." value=\"1\">1</option>
<option "
.(($bday['1'] == 2)? "selected=\"selected\"" '')." value=\"2\">2</option>
<option "
.(($bday['1'] == 3)? "selected=\"selected\"" '')." value=\"3\">3</option>
<option "
.(($bday['1'] == 4)? "selected=\"selected\"" '')." value=\"4\">4</option>
<option "
.(($bday['1'] == 5)? "selected=\"selected\"" '')." value=\"5\">5</option>
<option "
.(($bday['1'] == 6)? "selected=\"selected\"" '')." value=\"6\">6</option>
<option "
.(($bday['1'] == 7)? "selected=\"selected\"" '')." value=\"7\">7</option>
<option "
.(($bday['1'] == 8)? "selected=\"selected\"" '')." value=\"8\">8</option>
<option "
.(($bday['1'] == 9)? "selected=\"selected\"" '')." value=\"9\">9</option>
<option "
.(($bday['1'] == 10)? "selected=\"selected\"" '')." value=\"10\">10</option>
<option "
.(($bday['1'] == 11)? "selected=\"selected\"" '')." value=\"11\">11</option>
<option "
.(($bday['1'] == 12)? "selected=\"selected\"" '')." value=\"12\">12</option>
</select> 
<span class=\"genmed\">Year:</span> 
<select name=\"bday_year\">
<option value=\"0\">--</option>
<option "
.(($bday['2'] == 1910)? "selected=\"selected\"" '')." value=\"1910\">1910</option>
<option "
.(($bday['2'] == 1911)? "selected=\"selected\"" '')." value=\"1911\">1911</option>
<option "
.(($bday['2'] == 1912)? "selected=\"selected\"" '')." value=\"1912\">1912</option>
<option "
.(($bday['2'] == 1913)? "selected=\"selected\"" '')." value=\"1913\">1913</option>
<option "
.(($bday['2'] == 1914)? "selected=\"selected\"" '')." value=\"1914\">1914</option>
<option "
.(($bday['2'] == 1915)? "selected=\"selected\"" '')." value=\"1915\">1915</option>
<option "
.(($bday['2'] == 1916)? "selected=\"selected\"" '')." value=\"1916\">1916</option>
<option "
.(($bday['2'] == 1917)? "selected=\"selected\"" '')." value=\"1917\">1917</option>
<option "
.(($bday['2'] == 1918)? "selected=\"selected\"" '')." value=\"1918\">1918</option>
<option "
.(($bday['2'] == 1919)? "selected=\"selected\"" '')." value=\"1919\">1919</option>
<option "
.(($bday['2'] == 1920)? "selected=\"selected\"" '')." value=\"1920\">1920</option>
<option "
.(($bday['2'] == 1921)? "selected=\"selected\"" '')." value=\"1921\">1921</option>
<option "
.(($bday['2'] == 1922)? "selected=\"selected\"" '')." value=\"1922\">1922</option>
<option "
.(($bday['2'] == 1923)? "selected=\"selected\"" '')." value=\"1923\">1923</option>
<option "
.(($bday['2'] == 1924)? "selected=\"selected\"" '')." value=\"1924\">1924</option>
<option "
.(($bday['2'] == 1925)? " selected=\"selected\"" '')." value=\"1925\">1925</option>
<option "
.(($bday['2'] == 1926)? " selected=\"selected\"" '')." value=\"1926\">1926</option>
<option "
.(($bday['2'] == 1927)? " selected=\"selected\"" '')." value=\"1927\">1927</option>
<option "
.(($bday['2'] == 1928)? " selected=\"selected\"" '')." value=\"1928\">1928</option>
<option "
.(($bday['2'] == 1929)? " selected=\"selected\"" '')." value=\"1929\">1929</option>
<option "
.(($bday['2'] == 1930)? " selected=\"selected\"" '')." value=\"1930\">1930</option>
<option "
.(($bday['2'] == 1931)? " selected=\"selected\"" '')." value=\"1931\">1931</option>
<option "
.(($bday['2'] == 1932)? " selected=\"selected\"" '')." value=\"1932\">1932</option>
<option "
.(($bday['2'] == 1933)? " selected=\"selected\"" '')." value=\"1933\">1933</option>
<option "
.(($bday['2'] == 1934)? " selected=\"selected\"" '')." value=\"1934\">1934</option>
<option "
.(($bday['2'] == 1935)? " selected=\"selected\"" '')." value=\"1935\">1935</option>
<option "
.(($bday['2'] == 1936)? " selected=\"selected\"" '')." value=\"1936\">1936</option>
<option "
.(($bday['2'] == 1937)? " selected=\"selected\"" '')." value=\"1937\">1937</option>
<option "
.(($bday['2'] == 1938)? " selected=\"selected\"" '')." value=\"1938\">1938</option>
<option "
.(($bday['2'] == 1939)? " selected=\"selected\"" '')." value=\"1939\">1939</option>
<option "
.(($bday['2'] == 1940)? " selected=\"selected\"" '')." value=\"1940\">1940</option>
<option "
.(($bday['2'] == 1941)? " selected=\"selected\"" '')." value=\"1941\">1941</option>
<option "
.(($bday['2'] == 1942)? " selected=\"selected\"" '')." value=\"1942\">1942</option>
<option "
.(($bday['2'] == 1943)? " selected=\"selected\"" '')." value=\"1943\">1943</option>
<option "
.(($bday['2'] == 1944)? " selected=\"selected\"" '')." value=\"1944\">1944</option>
<option "
.(($bday['2'] == 1945)? " selected=\"selected\"" '')." value=\"1945\">1945</option>
<option "
.(($bday['2'] == 1946)? " selected=\"selected\"" '')." value=\"1946\">1946</option>
<option "
.(($bday['2'] == 1947)? " selected=\"selected\"" '')." value=\"1947\">1947</option>
<option "
.(($bday['2'] == 1948)? " selected=\"selected\"" '')." value=\"1948\">1948</option>
<option "
.(($bday['2'] == 1949)? " selected=\"selected\"" '')." value=\"1949\">1949</option>
<option "
.(($bday['2'] == 1950)? " selected=\"selected\"" '')." value=\"1950\">1950</option>
<option "
.(($bday['2'] == 1951)? " selected=\"selected\"" '')." value=\"1951\">1951</option>
<option "
.(($bday['2'] == 1952)? " selected=\"selected\"" '')." value=\"1952\">1952</option>
<option "
.(($bday['2'] == 1953)? " selected=\"selected\"" '')." value=\"1953\">1953</option>
<option "
.(($bday['2'] == 1954)? " selected=\"selected\"" '')." value=\"1954\">1954</option>
<option "
.(($bday['2'] == 1955)? " selected=\"selected\"" '')." value=\"1955\">1955</option>
<option "
.(($bday['2'] == 1956)? " selected=\"selected\"" '')." value=\"1956\">1956</option>
<option "
.(($bday['2'] == 1957)? " selected=\"selected\"" '')." value=\"1957\">1957</option>
<option "
.(($bday['2'] == 1958)? " selected=\"selected\"" '')." value=\"1958\">1958</option>
<option "
.(($bday['2'] == 1959)? " selected=\"selected\"" '')." value=\"1959\">1959</option>
<option "
.(($bday['2'] == 1960)? " selected=\"selected\"" '')." value=\"1960\">1960</option>
<option "
.(($bday['2'] == 1961)? " selected=\"selected\"" '')." value=\"1961\">1961</option>
<option "
.(($bday['2'] == 1962)? " selected=\"selected\"" '')." value=\"1962\">1962</option>
<option "
.(($bday['2'] == 1963)? " selected=\"selected\"" '')." value=\"1963\">1963</option>
<option "
.(($bday['2'] == 1964)? " selected=\"selected\"" '')." value=\"1964\">1964</option>
<option "
.(($bday['2'] == 1965)? " selected=\"selected\"" '')." value=\"1965\">1965</option>
<option "
.(($bday['2'] == 1966)? " selected=\"selected\"" '')." value=\"1966\">1966</option>
<option "
.(($bday['2'] == 1967)? " selected=\"selected\"" '')." value=\"1967\">1967</option>
<option "
.(($bday['2'] == 1968)? " selected=\"selected\"" '')." value=\"1968\">1968</option>
<option "
.(($bday['2'] == 1969)? " selected=\"selected\"" '')." value=\"1969\">1969</option>
<option "
.(($bday['2'] == 1970)? " selected=\"selected\"" '')." value=\"1970\">1970</option>
<option "
.(($bday['2'] == 1971)? " selected=\"selected\"" '')." value=\"1971\">1971</option>
<option "
.(($bday['2'] == 1972)? " selected=\"selected\"" '')." value=\"1972\">1972</option>
<option "
.(($bday['2'] == 1973)? " selected=\"selected\"" '')." value=\"1973\">1973</option>
<option "
.(($bday['2'] == 1974)? " selected=\"selected\"" '')." value=\"1974\">1974</option>
<option "
.(($bday['2'] == 1975)? " selected=\"selected\"" '')." value=\"1975\">1975</option>
<option "
.(($bday['2'] == 1976)? " selected=\"selected\"" '')." value=\"1976\">1976</option>
<option "
.(($bday['2'] == 1977)? " selected=\"selected\"" '')." value=\"1977\">1977</option>
<option "
.(($bday['2'] == 1978)? " selected=\"selected\"" '')." value=\"1978\">1978</option>
<option "
.(($bday['2'] == 1979)? " selected=\"selected\"" '')." value=\"1979\">1979</option>
<option "
.(($bday['2'] == 1980)? " selected=\"selected\"" '')." value=\"1980\">1980</option>
<option "
.(($bday['2'] == 1981)? " selected=\"selected\"" '')." value=\"1981\">1981</option>
<option "
.(($bday['2'] == 1982)? " selected=\"selected\"" '')." value=\"1982\">1982</option>
<option "
.(($bday['2'] == 1983)? " selected=\"selected\"" '')." value=\"1983\">1983</option>
<option "
.(($bday['2'] == 1984)? " selected=\"selected\"" '')." value=\"1984\">1984</option>
<option "
.(($bday['2'] == 1985)? " selected=\"selected\"" '')." value=\"1985\">1985</option>
<option "
.(($bday['2'] == 1986)? " selected=\"selected\"" '')." value=\"1986\">1986</option>
<option "
.(($bday['2'] == 1987)? " selected=\"selected\"" '')." value=\"1987\">1987</option>
<option "
.(($bday['2'] == 1988)? " selected=\"selected\"" '')." value=\"1988\">1988</option>
<option "
.(($bday['2'] == 1989)? " selected=\"selected\"" '')." value=\"1989\">1989</option>
<option "
.(($bday['2'] == 1990)? " selected=\"selected\"" '')." value=\"1990\">1990</option>
<option "
.(($bday['2'] == 1991)? " selected=\"selected\"" '')." value=\"1991\">1991</option>
<option "
.(($bday['2'] == 1992)? " selected=\"selected\"" '')." value=\"1992\">1992</option>
<option "
.(($bday['2'] == 1993)? " selected=\"selected\"" '')." value=\"1993\">1993</option>
<option "
.(($bday['2'] == 1994)? " selected=\"selected\"" '')." value=\"1994\">1994</option>
<option "
.(($bday['2'] == 1995)? " selected=\"selected\"" '')." value=\"1995\">1995</option>
<option "
.(($bday['2'] == 1996)? " selected=\"selected\"" '')." value=\"1996\">1996</option>
<option "
.(($bday['2'] == 1997)? " selected=\"selected\"" '')." value=\"1997\">1997</option>
<option "
.(($bday['2'] == 1998)? " selected=\"selected\"" '')." value=\"1998\">1998</option>
<option "
.(($bday['2'] == 1999)? " selected=\"selected\"" '')." value=\"1999\">1999</option>
<option "
.(($bday['2'] == 2000)? " selected=\"selected\"" '')." value=\"2000\">2000</option>
<option "
.(($bday['2'] == 2001)? " selected=\"selected\"" '')." value=\"2001\">2001</option>
<option "
.(($bday['2'] == 2002)? " selected=\"selected\"" '')." value=\"2002\">2002</option>
<option "
.(($bday['2'] == 2003)? " selected=\"selected\"" '')." value=\"2003\">2003</option>
<option "
.(($bday['2'] == 2004)? " selected=\"selected\"" '')." value=\"2004\">2004</option>
<option "
.(($bday['2'] == 2005)? " selected=\"selected\"" '')." value=\"2005\">2005</option>
<option "
.(($bday['2'] == 2006)? " selected=\"selected\"" '')." value=\"2006\">2006</option>
<option "
.(($bday['2'] == 2007)? " selected=\"selected\"" '')." value=\"2007\">2007</option>
<option "
.(($bday['2'] == 2008)? " selected=\"selected\"" '')." value=\"2008\">2008</option>
<option "
.(($bday['2'] == 2009)? " selected=\"selected\"" '')." value=\"2009\">2009</option>
<option "
.(($bday['2'] == 2010)? " selected=\"selected\"" '')." value=\"2010\">2010</option>
</select></p></td></tr>\n"
;
//Birthday Modd End 
Now Open index.php and where you want it to show add
PHP Code:
OpenTable("Birthday's");
$birthday_list '';
$now getdate(time() - date('Z'));
$sql "SELECT * FROM ".$db_prefix."_users WHERE ban = '0' AND birthday LIKE '%" $now['mday']."-"$now['mon']."-" "%'";
    
$result $db->sql_query($sql) or btsqlerror($sql);
    echo
'<img src="http://bvlist.com/images/Birthday_Cake.png" title="cake" alt="cake" />';
    while (
$row $db->sql_fetchrow($result))
    {
        if(
$row["donator"] == 'true')$donator true;
        else
        
$donator false;
$img '';
                if (
$row["level"] == "premium"$img .= pic("icon_premium.gif",'','premium');
                elseif (
$row["level"] == "moderator"$img .= pic("icon_moderator.gif",'','moderator');
                elseif (
$row["level"] == "admin"$img .= pic("icon_admin.gif",'','admin');
                if(
$donator$img .= '<img src="http://bvlist.com/images/donator.gif" height="16" width="16" title="donator" alt="donator" />';
                if(
$row["warned"] == "1"$img .= '<img src="http://bvlist.com/images/warning.gif" title="warned" alt="warned" />';
        
        
$name = ($row['name'] == '' $row['username'] : $row['name']);
        
$birthday_list .= (($birthday_list != '') ? ', ' '') ."<a href=\"user.php?op=profile&amp;id=".$row["id"]."\"><font color=\"".getusercolor($row["can_do"])."\">{$name}</font></a>{$img}";
        if (
$age = (int) substr($row['birthday'], -4))
        {        
            
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
        }
    }
    
$db->sql_freeresult($result);
echo 
$birthday_list;
CloseTable(); 
and add this image to your images folder Click the image to open in full size.
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/

Last edited by joeroberts; 22nd February 2010 at 05:33.
Reply With Quote
The Following 2 Users Say Thank You to joeroberts For This Useful Post:
daffy (21st February 2010), Giorgatzelos (13th June 2010)