Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 03-10-2014, 05:48 PM
ageurtse ageurtse is offline
 
Join Date: Apr 2009
Location: almelo
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i can't get it to work.
when i load a php from a external site, the php file is displayed when i host the php file on the vbulletin site. the file isn't show.

how can i display this php file within vbulletin.
and alternate parse some variables from vbulletin to this php file.

i think i have to make a template and a different php file, but i don't have any experience with that. i followed the tutorial as kh99 in his first post mentioned but i don't get it.

would someone help me with this. not with the code but just with some tutorial help.

[edit]
I came from a button click from within a different plugin, here is a small peace of code.

Code:
          $ptpnt_do = '';
            //$ptpnt_action = 'https://www.paypal.com/cgi-bin/webscr';
            $ptpnt_action = './test.php';
            $ptpnt_item = $foruminfo['forumid'] . '_' . $vbulletin->userinfo['userid'] .
and a small bit of the template

<form action="{vb:raw ptpnt_action}" method="post">
<vb:if condition="$show['ptpnt_total_price']">

when the submit button is pushed then my peace of code should come in.




PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php
// include the settings file
require("settings.php");

?>
<html>
    <head>
        <title>Transactie Pay.nl</title>

        <!-- css -->
        <link rel="stylesheet" type="text/css" href="includes/css/ppt.css" />

        <!-- script -->
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
        <script src="includes/script/ppt.js" type="text/javascript"></script>        
    </head>

    <body>

        <?php
        
if($_POST['submit_payment_method'])
        {
            try
            {
                
// an amount has been entered and an payment method has been chosen
                // now we can create a Pay.nl transaction
                
$objPay = new Transaction($iProgramId$iWebsiteId$iWebsiteLocationId$arrEmailAddress$iAccountId$strToken$boolDebugMode);

                
// set vars from settings.php
                
if(isset($_POST['external_order']) && strlen($_POST['external_order']) > 0)
                {
                  
$objPay->setExternalOrder($_POST['external_order']);
                }
                
$objPay->setExchangeUrl($strExchangeUrl);
                
$objPay->setReturnUrl($strReturnUrl);
                
$objPay->setTestMode($boolTestMode);

                
// check if a bank has been chosen
                
if(intval($_POST['payment_profile']) == 10)
                {                    
                    
$objPay->setBankId($_POST['bank_id']);
                }

                
// create transaction
                
$transaction $objPay->createTransaction(intval($_POST['amount']), intval($_POST['payment_profile']), array('extra1' => isset($_POST['external_order']) ? $_POST['external_order'] : ''));
            }
            catch(
Exception $exc)
            {
                
// set error in debug info
                
if(is_object($objPay) && $objPay->getDebugMode()) $objPay->doDebug('An error occured: ' $exc->getMessage(). ' - Script execution stopped');
                
                
// put error on screen
                
else echo 'An error occurend: '.$exc->getMessage(). ' - Script execution stopped';
                
                exit;
            }

            
// show Pay.nl transaction result
            
echo "<div class='ppt'>";

            echo 
"<p>";
            echo 
"U kunt uw betaling afronden via de onderstaande link.";
            echo 
"</p>";

            echo 
"<p>";
            echo 
"<a href='" $transaction['issuerUrl'] . "'>Betaling afronden</a>";
            echo 
"</p>";

            echo 
"</div>";
        }
        else
        {
            try
            {
                
// an amount has been entered and the submit button has been clicked
                // now we have to set the entered amount and display the available payment profiles
                // create object
                
$objPay = new Transaction($iProgramId$iWebsiteId$iWebsiteLocationId$arrEmailAddress$iAccountId$strToken$boolDebugMode);

                
// get the availabel payment profiles
                
$arrPaymentProfiles $objPay->getActivePaymentProfiles();

                
// generate select box with availabel payment profiles
                
$selectPaymentProfiles '<option>Selecteer</option>';
                if(
is_array($arrPaymentProfiles))
                {
                    foreach(
$arrPaymentProfiles as $arrPaymentProfile)
                    {
                        
$selectPaymentProfiles .= '<option value="' $arrPaymentProfile['id'] . '">' $arrPaymentProfile['name'] . '</option>';
                    }
                }

                
// if payment method 10 is available we need to show a list of banks
                
if($objPay->isBankList($arrPaymentProfiles))
                {
                    
$arrBankList $objPay->getIdealBanks();

                    if(
is_array($arrBankList))
                    {
                        
$selectBank '';

                        foreach(
$arrBankList as $arrBank)
                        {
                            
// generate list of banks
                            
$selectBank .= "<div><input type='radio' name='bank_id' value='" $arrBank['id'] . "' /><img src='" $arrBank['icon'] . "' alt='" $arrBank['name'] . "'></div>";
                        }
                    }
                }
            }
            catch(
Exception $exc)
            {
                
// set error in debug info
                
if(is_object($objPay) && $objPay->getDebugMode()) $objPay->doDebug('An error occured: ' $exc->getMessage());
                                
                
// put error on screen
                
else echo 'An error occurend: '.$exc->getMessage();
                
                exit;
            }

            echo 
"<div class='ppt'>";
            echo 
"<form method='POST'>";

            
// description
            
echo "<div>";
            echo 
"<p>";
            echo 
" test 2 Selecteer de gewenste betaalmethode en vul eventueel het ordernummer van uw systeem in.";
            echo 
"</p>";
            echo 
"<br />";
            echo 
"</div>";

            
// amount in cents
            
echo "<div>";
            echo 
"<label>";
            echo 
"Over te boeken bedrag:";
            echo 
"</label>";
            echo 
"<input type='hidden' name='amount' value='".$bedragtotaal."'/>";
            echo 
'&euro; '.number_format(($bedragtotaal100), 2',''');
            echo 
"  ***  ".$ptpnt_total_price;
            echo 
"</div>";


            
// optional: an external order
            
echo "<div>";
            echo 
"<label>";
            echo 
"Ordernummer van uw systeem:";
            echo 
"</label>";
            echo 
"<input type='hidden' name='external_order' value='vb_thread_1001' />";
            echo 
"vb_thread_1001";
            echo 
"</div>";

            
// available payment methods
            
echo "<div>";
            echo 
"<label>";
            echo 
"Selecteer betaalmethode:";
            echo 
"</label>";
            echo 
"<select name='payment_profile'>";
            echo 
$selectPaymentProfiles;
            echo 
"</select>";
            echo 
"</div>";

            
// list of banks in case iDEAL has been selected
            
echo "<div id='banks'>";
            echo 
"<label>";
            echo 
"Selecteer bank:";
            echo 
"</label>";
            echo 
"<div class='bankList'>";
            echo 
$selectBank;
            echo 
"</div>";
            echo 
"</div>";

            
// submit button
            
echo "<div>";
            echo 
"<input type='submit' name='submit_payment_method' value='Volgende stap' class='button' />";
            echo 
"</div>";

            echo 
"<div class='clear'></div>";

            echo 
"</form>";
            echo 
"</div>";
               }
        
?>                
    </body>
</html>
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03490 seconds
  • Memory Usage 2,578KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete