Bora Posted March 28, 2009 Share Posted March 28, 2009 Just thought I would show what I have done with this mod. I have modified the original code somewhat as well.It uses Java to open and close the window of transactions. I will get a chance to finish it off one of these days and add in the refund buttons. The screens look LEET. Hoping to see an update 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 29, 2009 Share Posted March 29, 2009 Hi Guys, Sorry I have been quite busy, I sat up till 3AM this morning to get this finished so you can download it it now from the link to my site in my signature below. I hope everyone likes it, Enjoy. Steve (Sparky) 0 Quote Link to comment Share on other sites More sharing options...
Bora Posted March 30, 2009 Share Posted March 30, 2009 Thanks sparky! Im gonna try it out now! 0 Quote Link to comment Share on other sites More sharing options...
Bora Posted March 30, 2009 Share Posted March 30, 2009 I might modify it so that I can show multiple currencies and also include another paypal the same way as a second box as I have 2 different paypal accounts one for US one for EU customers (dont ask why its complicated). if I get to do the modifications ill post them. (Sorry for creating a second post but I wasn't able to edit it since 15 minutes had passed.) 0 Quote Link to comment Share on other sites More sharing options...
druptech Posted April 5, 2009 Share Posted April 5, 2009 after add code in homepage.tpl it show blank page 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 5, 2009 Share Posted April 5, 2009 If you are getting a blank page it would mean that either the included file can't be found or that there is an error like cannot re declare a function. Try removing the code for the old paypal mod and try it again. To see the error put this line in your configuration.php file in your whmcs root $display_errors = 'on'; 0 Quote Link to comment Share on other sites More sharing options...
BulliteShot Posted April 5, 2009 Share Posted April 5, 2009 Thank you, a very nice implementation. 0 Quote Link to comment Share on other sites More sharing options...
Revolution Posted April 7, 2009 Share Posted April 7, 2009 If you are getting a blank page it would mean that either the included file can't be found or that there is an error like cannot re declare a function. Try removing the code for the old paypal mod and try it again. To see the error put this line in your configuration.php file in your whmcs root $display_errors = 'on'; Any way to get your code so that only Full Administrators can see the Paypal balance and not visible to any other operator. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 8, 2009 Share Posted April 8, 2009 Any way to get your code so that only Full Administrators can see the Paypal balance and not visible to any other operator. Email sent with modification 0 Quote Link to comment Share on other sites More sharing options...
BulliteShot Posted April 13, 2009 Share Posted April 13, 2009 Email sent with modification Drop me an email with that too, please 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted April 13, 2009 Share Posted April 13, 2009 replace the added paypalbalance code in homepage.tpl with this {php} $result = select_query("tbladminroles","id",array("id"=>$_SESSION['adminid'])); $data = mysql_fetch_array($result); $this->assign('roleid', $data['id']); {/php} {if $roleid == "1"} {literal} <script language="javascript"> function togglepaypaltrans() { if (document.getElementById('paypaltrans').style.display=="none") { document.getElementById('paypaltrans').style.display="block"; } else { document.getElementById('paypaltrans').style.display="none"; } } </script> {/literal} {include_php file="PayPalBalance/GetBalance.php"} <div align="right" style="position:absolute;top:25px;right:410px;width:200px;"> <table width="100%" cellspacing="1" cellpadding="0" bgcolor="#8FBCE9"> <tr> <td bgcolor="#ffffff"> <table width=100% cellpadding=2> <tr><td align="left" colspan="2" bgcolor="#EFF2F9" nowrap><img vspace="2" hspace="10" src="PayPalBalance/images/paypal_logo.png" align="left" /><strong>Account Balance</strong></td></tr> <tr><td align="right" nowrap>Account Balance</td><td bgcolor="#EFF2F9"" nowrap><strong>{if $paypalfail} {$paypalfail}{else} ${$paypalbalance} {$paypalcurrency}{/if}</strong></td></tr> <tr><td align="center" nowrap colspan="2">{$paypaltimestamp} GMT</td></tr> <tr><td align="center" nowrap colspan="2"><a href="#" onclick="togglepaypaltrans(); return false;"><strong>{$paypaltransactiontext}</strong> »</a></td></tr> </table> </td> </tr> </table> </div> <div style="display:none;" id="paypaltrans"> <div align="right" style="position:absolute;top:135px;left:110px;z-index:100;max-height:500px;overflow:auto;border:2px #ccc solid;"> {$paypaltransactions} </div> </div> {/if} 0 Quote Link to comment Share on other sites More sharing options...
redrat Posted April 13, 2009 Share Posted April 13, 2009 Thanks for this Steve. :0 0 Quote Link to comment Share on other sites More sharing options...
efisher Posted April 16, 2009 Share Posted April 16, 2009 {php} $result = select_query("tbladminroles","id",array("id"=>$_SESSION['adminid'])); $data = mysql_fetch_array($result); $this->assign('roleid', $data['id']); {/php} {if $roleid == "1"} ... {/if} Steve, I'm not sure, but I think the logic of the if statement is wrong. For me, I am only seeing the paypal box for the user id of 1, not the roleid of 1. For instance, I have a user that is id 3, but the roleid is set to 1. If I insert a debug line to print the value of $roleid for that user, I get 3. I'm new to embedding php in smarty, so I'm having a time figuring out the select_query function, but I'm not seeing where you select the roleid of the $_SESSION['adminid']. Can someone verify and suggest a fix? Thanks, -Eric 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted April 16, 2009 Share Posted April 16, 2009 swap tbladminroles to tbladmins and it'll work 0 Quote Link to comment Share on other sites More sharing options...
efisher Posted April 16, 2009 Share Posted April 16, 2009 swap tbladminroles to tbladmins and it'll work Thanks for pointing that out, Rob. Simple change, big help. For those that want the right code, use this bit (slightly modified from the original post by Steve): {php} $result = select_query("tbladmins","roleid",array("id"=>$_SESSION['adminid'])); $data = mysql_fetch_array($result); $this->assign('roleid', $data['roleid']); {/php} {if $roleid == "1"} ... This will only show the PayPal balance to those users in the "Full Administrator" group. If you want to change it to show for users in another group, just change the logic in '{if $roleid == "1"}'. -Eric 0 Quote Link to comment Share on other sites More sharing options...
Dean Posted April 20, 2009 Share Posted April 20, 2009 This is amazing, thanks to everyone who helped create it 0 Quote Link to comment Share on other sites More sharing options...
ES-Aizal Posted April 20, 2009 Share Posted April 20, 2009 If you haven't already done so, you need to log into Paypal and enable an API username and password, and along with that you will get an API signature. These are the items you will need to get the balance. It took me a few minutes of poking around on Paypal's site to just give up and use their search function. I searched for 'API' and I think the right page was the 3rd or 4th item down. If you already are using the API username/password/signature, then the post doesn't answer your question this time. -Eric I looked at the APIs but which should I choose? 0 Quote Link to comment Share on other sites More sharing options...
BullsoftHosting - Tom Posted April 20, 2009 Share Posted April 20, 2009 Very nice mod! Thanks a lot! 0 Quote Link to comment Share on other sites More sharing options...
IT Europe Posted May 17, 2009 Share Posted May 17, 2009 That is beautiful! Works straight out of the box! Thanks a million for this very handy piece of script. 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted May 24, 2009 Share Posted May 24, 2009 I need some help I have got Steve's code working but : 1, It is showing in as $000.00 GBP so how do I change the code to show it right as £000.00 GBP? 2, I have 2 Currencies setup in my paypal account a, British Pound (Primary) b, US Dollars So how can I show them all? 3, and I also have in my Paypal account PayPal balance box at the top "Current Total in GBP:" so how can I show this to? 0 Quote Link to comment Share on other sites More sharing options...
silentkiller Posted May 25, 2009 Share Posted May 25, 2009 Is this working for 4.0? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 25, 2009 Share Posted May 25, 2009 I need some help I have got Steve's code working but : 1, It is showing in as $000.00 GBP so how do I change the code to show it right as £000.00 GBP? 2, I have 2 Currencies setup in my paypal account a, British Pound (Primary) b, US Dollars So how can I show them all? 3, and I also have in my Paypal account PayPal balance box at the top "Current Total in GBP:" so how can I show this to? 1. In your homepage.tpl find this line and change the highlighted (bolded) character for your currency symbol <tr><td align="right" nowrap>Account Balance</td><td bgcolor="#EFF2F9"" nowrap><strong>{if $paypalfail} {$paypalfail}{else} [b]$[/b]{$paypalbalance} {$paypalcurrency}{/if}</strong></td></tr> 2. & 3. By default the PayPal API I believe only retrieves the default currency set in your paypal account. Is this working for 4.0? Yes it works in V4 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted May 25, 2009 Share Posted May 25, 2009 (edited) 1. In your homepage.tpl find this line and change the highlighted (bolded) character for your currency symbol <tr><td align="right" nowrap>Account Balance</td><td bgcolor="#EFF2F9"" nowrap><strong>{if $paypalfail} {$paypalfail}{else} [b]$[/b]{$paypalbalance} {$paypalcurrency}{/if}</strong></td></tr> Thanks for that i have just removed the symbol and it look better as you have the {$paypalcurrency} pulled in anyway. Do you know the line in the GetBalance.php so I can take out the same symbol out of that page? Thanks P.s this forum should look at putting the "Thanks" mod on the forum so we could then see the post's to trust and the ones not to trust? http://www.vbulletin.org/forum/showthread.php?t=165673 Edited May 25, 2009 by thehost5968 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 25, 2009 Share Posted May 25, 2009 it should be on line 115 in 3 places (have marked them in bold) $tmptrans .= '<tr align="center" bgcolor="'.(($resArray["L_AMT".$ID] > 0) ? "#ffffff" : "#ffcccc").'"><td>'.$type.'</td><td>'.$transactionID.'</td><td nowrap>'.$timeStamp.'</td><td>'.$status.'</td><td>'.$payerName.'<br />'.$payerEmail.'</td><td nowrap>[b]$[/b]'.$amount.' '.$ppcurrency.'</td><td nowrap>[b]$[/b]'.$ppfee.' '.$ppcurrency.'</td><td nowrap>[b]$[/b]'.$net.' '.$ppcurrency.'</td></tr>'; 0 Quote Link to comment Share on other sites More sharing options...
thehost5968 Posted May 25, 2009 Share Posted May 25, 2009 it should be on line 115 in 3 places (have marked them in bold) $tmptrans .= '<tr align="center" bgcolor="'.(($resArray["L_AMT".$ID] > 0) ? "#ffffff" : "#ffcccc").'"><td>'.$type.'</td><td>'.$transactionID.'</td><td nowrap>'.$timeStamp.'</td><td>'.$status.'</td><td>'.$payerName.'<br />'.$payerEmail.'</td><td nowrap>[b]$[/b]'.$amount.' '.$ppcurrency.'</td><td nowrap>[b]$[/b]'.$ppfee.' '.$ppcurrency.'</td><td nowrap>[b]$[/b]'.$net.' '.$ppcurrency.'</td></tr>'; Thanks you are the best. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.