Fork me on GitHub

Modifying pnAffiliate Thanks Page  Bottom

  • I am trying to modify the thank you page for the pnAffiliate module so that I can give my users more instructions on what to do next. Currently I am using the stock code below.


    Code

    <?
    $payment="5.00";//Put the amount that you wish to pay to affiliates who are responsible for this sale
    include 'includes/pnAPI.php';
    pnInit();
    include 'modules/pnAffiliate/includes/registersale.php';
    $output = new pnHTML();
    $output->StartPage();
    $output->SetInputMode(_PNH_VERBATIMINPUT);
    $output->text("thank you");
    $output->EndPage();
    $output->PrintPage();
    ?>


    Here is where I am running into problems that the code

    Code

    $output->text("thank you");
    Generates small text crammed right up against the header of the generated page. Unfortunately it makes it hard to read and the uninitiated may miss it and just see a Blank Page.

    What I would like to do is make the output in HTML instead of txt so that the text can be spaced down a bit more toward the center of the page and in a larger font size. I would also like to be able to include links to direct the user to take more action.

    I have tried several different approaches but I always wind up with the text at the top before the page renders, at the bottom after the page renders or creating a parse error because I am hunting around in the dark.

    Thanks in advance for any help.

    Bill
  • The code looks correct, I bet your theme is the culprit. What theme are you using?
  • I am using the PostNuke theme that shipped with .726 (the brown one). I made some modifications to the colors on the theme but nothing else. I was hoping that there might be a way to change $output->text("text here"); maybe like $output->HTML("markup and links here"); but I have not been able to find anything that works.

    I have also tried escaping out of PHP after the text output and including the markup that I want but that doesn't work either.

    Thanks for the input

    Bill
  • Well it took me long enough but with a generous amount of searching and probably more than a small bit of luck I solved my problem at least enough that the thanks page looks acceptable.

    Here is the code that I came up with.

    The URL that I found my answer is at the bottom of this post.

    Code

    <?
    $payment="5.00";//Put the amount that you wish to pay to affiliates who are responsible for this sale

    include 'includes/pnAPI.php';
    pnInit();
    include 'modules/pnAffiliate/includes/registersale.php';
    $output = new pnHTML();
    $output->StartPage();

    $output->SetInputMode(_PNH_VERBATIMINPUT);

    //Here is where the modified code begins
    //Line breaks to bring the data down toward the center of the page
    //so that it is not crammed all the way into the header

    $output->Linebreak($numbreaks = 10);



    //Title to create a larger font size for the thank you
    //Not as large as I would like but it will do until I figure something else out

    $output->Title('Thank You For Your Order');



    //Another line break pretty much self explanitory now
    $output->Linebreak($numbreaks = 1);


    //Make some bold text
    $output->BoldText('Bold Text goes here');
    $output->Linebreak($numbreaks = 1);
    $output->BoldText('More bold text here');
    $output->Linebreak($numbreaks = 2);


    //plain old text

    $output->Text('Obviously some plain old text here');
    $output->Linebreak($numbreaks = 1);

    //note the space after text so that text and the following mailto url has a space between them
    $output->Text('And some more plain old text ');

    //a mailto URL

    $output->Text('<a href="mailto:username@domain.tld">username@domain.tld</a>');
    $output->Linebreak($numbreaks = 2);

    //more text

    $output->Text('amazingly enough some more plain text ');
    $output->Linebreak($numbreaks = 1);


    //a hyperlink

    $output->Text('<a href="http://www.paypal.com">www.paypal.com </a>');



    $output->Text('and lastly but not leastly some more plain text);


    $output->EndPage();
    $output->PrintPage();
    ?>





    http://noc.postnuke.…hp/9/38/pnHTML.html

    Bill
  • You mean you just wanted to know how to improve the page design using pnHTML? I don't see any difference between the two other than a lot more display text. Am I missing something?
  • Yes, I wanted to improve the page design. That's what I said in my original post. When I first started working with the module I was not sure what I was looking for to make these improvements. It took me a while to figure out the pnHTML class was what I was looking for in order to do that.

    Yes there is more display text but I was also able to get the URLs, linebreaks, and bold text in as well. I would still like to be able to use other formating but for now this does what I need it to do. I can go farther as I figure out how all of the functions work.

    Unfortunately, what little documentation I found was cryptic at best. Hopefully the next time someone comes along looking for information on this they will not have to spend a week looking for one page of documentation that only makes sense if you have been at this for half a dozen years. 8)

    Bill

This list is based on users active over the last 60 minutes.