Forums: How do I Integrate this template with my Website? - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

How do I Integrate this template with my Website?

#1 User is offline   erago 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 30
  • Joined: 14-April 08

Posted 29 April 2008 - 05:17 PM

Thank you Jane for your response.

Now it is working as it is in the demo. now I have two Projects lets say "Primary" Project and "Members1" Project.
I am sure it is very simple. but how do I integrate them so that they work together? I am assuming that I put "Members1" Output Files in another Directory. and do i need to modify anything in the projects so that they communicate properly. or do I have it completely wrong?

"""""""""""Hi,

first open members template as a separate project.

Also if you have selected email as user name you need to change AfterSuccessfulRegisrtation event on the events tab.
Here is a sample:
-------------------------------------------------------
...
if($userdata["Email"]!="" && $userdata["Password"]!="")
{
$tmpSQL="select * from users where Email='" . $userdata["Email"] . "' and Password='" . $userdata["Password"] . "'";
$rs = db_query($tmpSQL,$conn);
$data = db_fetch_array($rs);
$_SESSION["ppuid"]=$data["ID"];
$uemail=$data["Email"];
$uname=$data["Email"];
...
-------------------------------------------------------""""""""""
0

#2 User is offline   erago 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 30
  • Joined: 14-April 08

Posted 03 May 2008 - 07:23 PM

I Figured it out. I guess saying that you open the Members Template as a separate Project. Isn't very clear.
that's what I did and it didn't fix the problem. I guess one is to say to create your Project starting with the members template. Not a Separate Template.

If you already have a project or website. then create a separate Project with the template. then append your tables. and events from members to your project. ( copy and paste)

I had to do the later. I did start my project with the members Template. but somehow I'm not sure the events for that template got erased along the way.

Only other bug or question. is If the price selected is $0.00 then why still send to the paypal page. why not process the registration and insert the values into "Beginpay" and "Endpay" of the Users Table according to the Dcount Value Selected and send to the login Page instead?

any one familiar enough with PHPRunner to know how to do that?

or at the least a Quick Fix in the mean time.
I have also been experimenting to disable the members template (by changing certain fields so that it directs to login after Registration, like it was before it was fixed ie.. username to email values, as I Use Email as Username on my site) and using a Event in "after successful Registration" to Insert the Beginpay ,Endpay and Active Values to the appropriate User. using the following Code:

global $conn, $smarty;
$pp="";
$smarty->assign("payment","");
if($userdata["Email"]!="" && $userdata["Password"]!="")
{
$tmpSQL="select * from users where Email='" . $userdata["Email"] . "' and Password='" . $userdata["Password"] . "'";
$rs = db_query($tmpSQL,$conn);
$data = db_fetch_array($rs);
$_SESSION["ppuid"]=$data["ID"];
$uemail=$data["Email"];
$uname=$data["Email"];
$tmpSQL="select * from options";
$rs = db_query($tmpSQL,$conn);
$data = db_fetch_array($rs);
$http_full="http://".$_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
$emailtext=$data["Reg_text"];
$emailtext=str_replace("##username##",$uname,$emailtext);
$emailtext=str_replace("##payment_link##",$http_full . "login.php?a=pp0&uid=" , $_SESSION["ppuid"],$emailtext);
$message=$emailtext;
$subject=$data["Reg_subj"];
$conf=$data["Regconfirm"];

if($conf!=0)
mail($uemail, $subject, $message);
}
//********** Insert Beginpay, Endpay and active Data ************
global $conn;
$strSQLInsert = "insert into users (active, Beginpay, Endpay) values (1, now(), now()) where Email='" . $userdata["Email"] . "'";
db_exec($strSQLInsert,$conn);

I have also tried the ( where Email='".$_SESSION["UserID"]."'"; ) as well but I keep getting a MySQL error page indicating there is an error at the where clause. and tried it without the where clause which creates no error page, but doesn't work properly either.

I need these values in the table so that when the free membership period is over then the data is there to require to renew the membership once I decide to start charging for memberships.

any one have a solution?
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked