SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help fixing bugs in program

    I bought a PHP script for running a dating site but it has several bugs and the designers are trying to get me to pay to fix them so I am attempting to do it my self. I was successful to a point but now I am stuck and I lack the knowledge to find the solution.

    The problems:
    Non paying members are able to access their mailbox on my server and read and reply to messages sent by paying members.

    I need to block the mailbox to non payers and return an error directing them to the subscription page.
    -------------------

    I can't add fields to the registration form and make it display in the member's profile view. It came with a tool in the admin panel which is supposed to do this but when applied, nothing happens and the designer says it was intentional and I have to pay them to add fields.

    I need to add new fields and have one (INTERESTS) displayed horizontally with comma separations. It currently runs vertically and makes the page stretch ridiculously long if all the choices are used.
    -------------------

    It has a feature to allow the member to hide their photos and apply a password. When used it allows the first photo uploaded to be displayed and all the others requiring the password. They say it is supposed to block all and display an image called private_photo.gif but that does not happen. Also if the user removes all their photos or remove the password, it still displays the password field on their profile page indicating that a password is required.

    I need it to do the opposite of all that.
    ----------------------

    These are not additional features I'm seeking. They are truly bugs which I need fixed and anyone's assistance would be greatly appreciated. Even if it's guidance only.

    The entire file package can be downloaded from WD1.zip I will supply my server and admin panel access when someone contacts me.

    I have been testing my feeble attempt at code repairs at a test site at http://www.mellique.com/date

    Many thanks for the assistance.
    Last edited by peeta; Nov 24, 2004 at 13:06.

  2. #2
    SitePoint Evangelist nick0161's Avatar
    Join Date
    Oct 2004
    Location
    australia
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you go through one at a time, you'd be better off, and then if you get stuck post at sitepoint....

  3. #3
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I were you, I'd put at least some of your energy into trying to get your money back. The designers screwed you once by selling you a script that doesn't work, and now they're trying to screw you again by getting you to pay them even more money to fix their buggy script?
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  4. #4
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To get my money back is going to take a lot of time and energy since they are already claiming that all my complaints were intentional designs and not faults with the program.

  5. #5
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nick0161
    if you go through one at a time, you'd be better off, and then if you get stuck post at sitepoint....
    That's a good suggestion, however I would not know what files to extract for correction therefore I figure if all the problems are mentioned and someone has the entire package, then they'd be able to tackle even one problem.

  6. #6
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just help me get the code correct to stop non paying members from accessing their mailbox and I'll try to sort out the rest.

  7. #7
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    The code for editing

    The following code is what is executed when a user tries to send mail. It works excellent to block a non payer yet allow a paying user. It is a file on the server.

    Code:
    <?
    		 $f_profile = f(q("SELECT name, email, member_id FROM dt_profile WHERE id='$profile_id'"));
    		 $f_user = f(q("SELECT system_status, system_status_end FROM dt_members WHERE id='$f_profile[member_id]'"));
             $f_balance = f(q("SELECT balance FROM dt_stamps_balance WHERE member_id='$fMember[id]'"));
    
    		 if($f_profile == "" || $f_user == "")
    		 {
    				return;
    		 }
             $free_profile = 0;
             $can_contact = 0;
             $valid = 0;
    
             if($fMember[ unlimited ] && $fMember[ unlimited_end ] > strtotime(date("d M Y H:i:s")))
             {
                $free_profile = 1;
                $can_contact = 0;
             }
             else
             {
                if($f_user[ system_status ] && ($f_user[ system_status_end ] > strtotime(date("d M Y H:i:s")))) $free_profile = 1;
                if($f_balance[ balance ] >= 1) $can_contact = 1;
             }
    
    
    
    		 if(!$free_profile && !$can_contact)
    		 {
    				include "templates/cannot_contact.ihtml";
    				return;
    		 }
    
    		 $profile_name = $f_profile[ name ];
    		 $profile_email = $f_profile[ email ];
    		 $f_address_book = f(q("SELECT id FROM dt_address_book WHERE contact_profile_id='$profile_id' AND member_id='$fMember[id]'"));
    
    		 if($f_address_book != "")
    		 {
    				$free_profile = 1;
    		 }
    		 else
    		 {
    				$sql = "INSERT INTO dt_address_book	(member_id, contact_profile_id) VALUES ('$fMember[id]', '$profile_id')";
    				q($sql);
    		 }
             $mid = $profile_id;
    		 if($free_profile)
    		 {
                    $valid = 1;
                    include "engine/pages/send_message.pml";
    				return;
    		 }
    
     		if($can_contact)
    		{
                 q("UPDATE dt_stamps_balance SET balance=balance-1 WHERE member_id='$fMember[id]'");
    
                 $valid = 1;
                 include "engine/pages/send_message.pml";
    			 return;
    		}
    ?>
    These next lines of code are what executes when any user clicks on their mailbox link. Can I include any part of the above code in this one to make it do the same as above? This is also a file on the server.

    Code:
    <?
            $r_records = q("SELECT id, rid, sid, subject, timesent, is_read FROM dt_messages WHERE (rid='$fMember[id]' and is_deleted = 0) ORDER BY timesent DESC");
            $total_messages = (int)nr($r_records);
            include "templates/inbox.ihtml";
    
    ?>

  8. #8
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what you need for that second bit of code is this:
    Code:
    <?
    if($can_contact) {
            $r_records = q("SELECT id, rid, sid, subject, timesent, is_read FROM dt_messages WHERE (rid='$fMember[id]' and is_deleted = 0) ORDER BY timesent DESC");
            $total_messages = (int)nr($r_records);
            include "templates/inbox.ihtml";
    }		
    
    ?>
    Of course, I'm assuming that the first section of code has executed first. Otherwise, this will block everyone.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  9. #9
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for help Vinyl_Junkie, but the files are not related. The code at the top executes when a user attempts to send mail to another while viewing their profile and blocks them if they don't have a paid subscription. The second file executes when a user goes to their own account and click the MAILBOX link which then returns inbox.ihtml.

    I am trying to extract or modify the first code to do the same blocking when a non payer clicks the mailbox link to access their mail.

  10. #10
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wasn't sure if what I gave you was all you needed, since I don't have a complete picture of your application.

    Here's what I think you need:
    Code:
    <?
    		 //$f_profile = f(q("SELECT name, email, member_id FROM dt_profile WHERE id='$profile_id'"));
    		 $f_user = f(q("SELECT system_status, system_status_end FROM dt_members WHERE id='$f_profile[member_id]'"));
             //$f_balance = f(q("SELECT balance FROM dt_stamps_balance WHERE member_id='$fMember[id]'"));
    
    		 if($f_profile == "" || $f_user == "")
    		 {
    				return;
    		 }
             $free_profile = 0;
             $can_contact = 0;
             $valid = 0;
    
             if($fMember[ unlimited ] && $fMember[ unlimited_end ] > strtotime(date("d M Y H:i:s")))
             {
                $free_profile = 1;
                $can_contact = 0;
             }
             else
             {
                if($f_user[ system_status ] && ($f_user[ system_status_end ] > strtotime(date("d M Y H:i:s")))) $free_profile = 1;
                if($f_balance[ balance ] >= 1) $can_contact = 1;
             }
    
    		if($can_contact) {
            	$r_records = q("SELECT id, rid, sid, subject, timesent, is_read FROM dt_messages WHERE (rid='$fMember[id]' and is_deleted = 0) ORDER BY timesent DESC");
            	$total_messages = (int)nr($r_records);
            	include "templates/inbox.ihtml";
    		}		
    
    ?>
    Let us know if that works.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  11. #11
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I applied the script and it causes a blank page to return. Not an error page just empty. This link goes to the test site http://www.mellique.com/date
    login = lucy
    pswd = lucy

    click the MAILBOX link in the members menu to see what is being returned.
    Click WHO'S ONLINE link and click on the name then click send email under the photo to see the kind of return I want to achieve with the mailbox link

    Again I greatly appreciate your assistance

  12. #12
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're getting a blank page because there is some sort of error. It does that sometimes without giving you an error message.

    Put this at the top of your script and hopefully you'll get an error message to display:

    Code:
    error_reporting(E_ALL);
    ini_set("error_reporting","E_ALL");
    If that still doesn't give you a clue, try putting this statement is different places in the code until you identify just which line of code is causing you to get the blank page.

    Code:
    die("We got this far!");
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  13. #13
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The first error code did nothing. The second one stopped showing up on the page after the line where it is now.

    Code:
    <?
    
    		 //$f_profile = f(q("SELECT name, email, member_id FROM dt_profile WHERE id='$profile_id'"));
    		 $f_user = f(q("SELECT system_status, system_status_end FROM dt_members WHERE 
    
    id='$f_profile[member_id]'"));
             //$f_balance = f(q("SELECT balance FROM dt_stamps_balance WHERE member_id='$fMember[id]'"));
    die("We got this far!");
    		 if($f_profile == "" || $f_user == "")
    		 {
    				return;
    		 }
             $free_profile = 0;
             $can_contact = 0;
             $valid = 0;
    
             if($fMember[ unlimited ] && $fMember[ unlimited_end ] > strtotime(date("d M Y H:i:s")))
             {
                $free_profile = 1;
                $can_contact = 0;
             }
             else
             {
                if($f_user[ system_status ] && ($f_user[ system_status_end ] > strtotime(date("d M Y H:i:s")))) 
    
    $free_profile = 1;
                if($f_balance[ balance ] >= 1) $can_contact = 1;
             }
    
    		if($can_contact) {
            	$r_records = q("SELECT id, rid, sid, subject, timesent, is_read FROM dt_messages WHERE 
    
    (rid='$fMember[id]' and is_deleted = 0) ORDER BY timesent DESC");
            	$total_messages = (int)nr($r_records);
            	include "templates/inbox.ihtml";
    		}	
    
    ?>

  14. #14
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change this whole section of code:

    Code:
    		 //$f_profile = f(q("SELECT name, email, member_id FROM dt_profile WHERE id='$profile_id'"));
    		 $f_user = f(q("SELECT system_status, system_status_end FROM dt_members WHERE 
    
    id='$f_profile[member_id]'"));
             //$f_balance = f(q("SELECT balance FROM dt_stamps_balance WHERE member_id='$fMember[id]'"));
    die("We got this far!");
    to this instead and see what you get:

    Code:
    		 $f_profile = f(q("SELECT name, email, member_id FROM dt_profile WHERE id='$profile_id'"));
    		 $f_user = f(q("SELECT system_status, system_status_end FROM dt_members WHERE 
    
    id='$f_profile[member_id]'"));
             $f_balance = f(q("SELECT balance FROM dt_stamps_balance WHERE member_id='$fMember[id]'"));
    die("We got this far!");
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  15. #15
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The blank page still appears. Would you rather look at the entire program layout or FTP access the server?

  16. #16
    $this->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Dec 2003
    Location
    Federal Way, Washington (USA)
    Posts
    1,524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, that would help. There are obviously some pieces to the puzzle that I'm not seeing with just the code you've posted. Maybe someone else can take a stab at it as well if we can see the whole thing.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    Showcase your music collection on the Web

  17. #17
    SitePoint Member
    Join Date
    Nov 2004
    Location
    tampa, fl
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Details sent to your inbox. Thanks


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
  •