Results 1 to 9 of 9

Thread: How to fix ages on profile page:

  1. #1
    Join Date
    Jun 2007
    Posts
    197

    Default How to fix ages on profile page:

    Dear admin,

    The following should fix the age problem within the script. At present it uses the year to figure out a users age, with this it will use the full date of birth to work out and display the age.

    ------------------------------------------------------------

    In the include/function.php page add the following at the footer:

    function insert_userage($a)
    {
    global $conn;
    $sql="SELECT bdate,(YEAR(CURRENT_DATE) - YEAR(bdate)) - (DATE_FORMAT(CURRENT_DATE, '%d%m') < DATE_FORMAT(bdate, '%d%m')) AS userage FROM signup WHERE UID=$_REQUEST[UID]";
    $rs=$conn->execute($sql);
    return $rs->fields[userage];
    }
    Next in the templates/user.tpl change:

    {if $user_info[0].bdate ne "0000-00-00"}
    <TR>
    <TD>Age:</TD>
    <TD>{$profileage}</TD>
    </TR>
    {/if}
    To:

    {if $answers[0].bdate ne "0000-00-00"}
    <TR>
    <TD>Age: {insert name=userage assign=user_age}</TD>
    <TD>{$user_age}</TD>
    </TR>
    {/if}
    -------------------------------------------------------------------

    I'm about 95% sure that this will fix the current age problems within the script, however because the function.php page is encrypted I can not test this.

    If sucessful please could you upload the patched files so that we can correct our profiles page and give us a mention.

    Regards,
    Mathew Rennie.
    ------------------------------------
    Make an arse of yourself:
    http://www.youtwatonline.com
    ------------------------------------

  2. #2
    Join Date
    May 2007
    Posts
    686

    Default

    Hey very nice fix galnet nice job, any other fixes you have found?

  3. #3
    Join Date
    May 2007
    Posts
    686

    Default

    Before ANYONE tries this DONT go add it to the fuction.php using cpanel please, it will stop your website from displaying and give the error:

    Fatal error: Incompatible file format: The encoded file has format ID 0, which is too old in /home/****/public_html/include/function.php on line 0

    If i understand this it must be added to the footer of the 'function.php' then uploaded in BINARY. Is this correct?

    PLEASE DO NOT TRY THIS FIX TILL CONFIRMED

  4. #4
    Join Date
    Apr 2007
    Posts
    2,202

    Default

    User age, we already fixed it, not yet released as we have few other works pending, once we finish this, we will release it.

  5. #5
    Join Date
    May 2007
    Posts
    686

    Default

    Sweet can you give us an idea of what you are releasing Next Admin? Im always keen to know

  6. #6
    Join Date
    Apr 2007
    Posts
    2,202

    Default

    We plan to have next release on 24th.

  7. #7
    Join Date
    Jun 2007
    Posts
    197

    Default

    Quote Originally Posted by zeffer
    Before ANYONE tries this DONT go add it to the fuction.php using cpanel please, it will stop your website from displaying and give the error:

    Fatal error: Incompatible file format: The encoded file has format ID 0, which is too old in /home/****/public_html/include/function.php on line 0

    If i understand this it must be added to the footer of the 'function.php' then uploaded in BINARY. Is this correct?

    PLEASE DO NOT TRY THIS FIX TILL CONFIRMED
    Agreed, do not try this yourself. As the admin says this has already been fixed in the next version.

    If you try adding it to function.php yourself you will break the encryption and your site will not work!
    ------------------------------------
    Make an arse of yourself:
    http://www.youtwatonline.com
    ------------------------------------

  8. #8
    Join Date
    Jun 2007
    Location
    USA
    Posts
    123

    Default

    My site doesn't show user age?

  9. #9
    Join Date
    Apr 2007
    Posts
    2,202

    Default

    Quote Originally Posted by GreenGambler
    My site doesn't show user age?
    Will show only if they enter date of birth.

Similar Threads

  1. Profile Pic and URL on View Video Page
    By grynmoors in forum Template Modifications
    Replies: 0
    Last Post: 10-13-2008, 01:23 AM
  2. make other page with new video like in index page
    By cmedia in forum Template Modifications
    Replies: 4
    Last Post: 05-29-2008, 10:23 PM
  3. Search for users does not take you to profile page
    By grynmoors in forum Fixed Bugs
    Replies: 2
    Last Post: 02-15-2008, 07:10 AM
  4. Additional Ad Block On Profile Page
    By OctaviousButler in forum Feature Requests
    Replies: 1
    Last Post: 11-09-2007, 10:35 PM
  5. Edit user profile page
    By cwkerns in forum Feature Requests
    Replies: 2
    Last Post: 09-14-2007, 09:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •