Author |
Message |
pdi-doc
New Member


Joined: Mar 12, 2007
Posts: 22
Location: UK
|
Posted:
Thu Feb 21, 2008 2:52 am |
|
Hey guys,
I was hoping someone could help me, I am trying to get the direct buy links to work with the paypal generated form script:
Code:<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="jamesdunford@soclan.co.uk">
<input type="hidden" name="item_name" value="Ad-Zone Top">
<input type="hidden" name="item_number" value="AD1">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
|
But no matter what I do it just won't have it, I can put something like:
Code:http://www.pd-inc.co.uk/modules.php?name=Advertising&file=page1
|
And that isnt even clickable you have to highlight it and copy and paste into the address bar.
I thought this issue was resolved in 2.20?
If anyone knows of a way to get this sorted it would be very much appreciated.
DoC |
_________________ (\__/)
(='.'=) This is bunny. Copy and paste in to
(")_(") your signature to help him gain
/\/\/\/\ world domination.
Last edited by pdi-doc on Fri Feb 22, 2008 8:50 pm; edited 1 time in total |
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Thu Feb 21, 2008 11:01 am |
|
When you say "it just won't have it" - what do you mean? Are you trying to enter an ad whose content is HTML, including a form? If so, that would be because the form tags (form, input) aren't defined as valid HTML tags. You generally wouldn't want people to insert forms as content on your site (e.g. when submitting news or adding comments, etc.) - and the valid HTML tags array in config.php controls that. I wouldn't recommend adding those tags to the valid HTML array, but the other option is changing the ad maintenance to allow HTML without checking the valid HTML array (you would definitely want this to be limited to admins). |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
pdi-doc

|
Posted:
Thu Feb 21, 2008 1:12 pm |
|
no its not for an ad its the buy it now link.
When you go to paypal and create a button you are given that code that i showed above (the FORM one).
The Advertising module that comes with ravens nuke does not allow me to put that code into the admin/Plans & Prices/ area. See below image for exactly what im trying to do!
Updated the picture as the last one included my second screen!
I hope that shows a more detailed explanation of what I am trying to acheive...
Many Thanks
DoC |
Last edited by pdi-doc on Fri Feb 22, 2008 8:51 pm; edited 1 time in total |
|
|
 |
pdi-doc

|
Posted:
Fri Feb 22, 2008 5:31 pm |
|
Hey guys,
Has anyone thought of anything coz im at the point of loosing hair LOL
I have tried and tried to get it to pick up on the Paypal buy now button as shown above but its still a no go.
Im not sure which file in the Advertising module I should be hunting through either so I can allow a form to be used in the Buy Links input.
Many Thanks
DoC |
Last edited by pdi-doc on Fri Feb 22, 2008 8:51 pm; edited 1 time in total |
|
|
 |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Fri Feb 22, 2008 6:19 pm |
|
I'm looking at the code right now and it does not strip out HTML for the buy links text area. OOOPS! I see a bug. It isn't being addslashed.
Try this.
Find this code in modules/Advertising/admin/index.php
Code:
function ad_plans_add($name, $description, $delivery, $type, $price, $buy_links, $status) {
global $prefix, $db, $banners, $admin_file, $ad_admin_menu;
if (!empty($name) AND !empty($description) AND !empty($delivery) AND (isset($type) AND is_numeric($type)) AND !empty($price) AND !empty($buy_links) AND !empty($status)) {
$name = addslashes(check_words(check_html($name, 'nohtml')));
$description = addslashes(check_words(check_html($description, '')));
$price = addslashes(check_words(check_html($price, 'nohtml')));
// $buy_links = addslashes(check_words(check_html($buy_links, "")));
$db->sql_query('INSERT INTO ' . $prefix . '_banner_plans VALUES (NULL, \'' . $status . '\', \'' . $name . '\', \'' . $description . '\', \'' . $delivery . '\', \'' . $type . '\', \'' . $price . '\', \'' . $buy_links . '\')');
|
Please change it to this and give it a try.
Code:
function ad_plans_add($name, $description, $delivery, $type, $price, $buy_links, $status) {
global $prefix, $db, $banners, $admin_file, $ad_admin_menu;
if (!empty($name) AND !empty($description) AND !empty($delivery) AND (isset($type) AND is_numeric($type)) AND !empty($price) AND !empty($buy_links) AND !empty($status)) {
$name = addslashes(check_words(check_html($name, 'nohtml')));
$description = addslashes(check_words(check_html($description, '')));
$price = addslashes(check_words(check_html($price, 'nohtml')));
$buy_links = addslashes($buy_links);
$db->sql_query('INSERT INTO ' . $prefix . '_banner_plans VALUES (NULL, \'' . $status . '\', \'' . $name . '\', \'' . $description . '\', \'' . $delivery . '\', \'' . $type . '\', \'' . $price . '\', \'' . $buy_links . '\')');
|
Let us know. If this works I'll open an issue in our bug tracker and get this resolved for the upcoming patch release. |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
pdi-doc

|
Posted:
Fri Feb 22, 2008 8:44 pm |
|
Hey Gremmie,
Thanks for replying mate
Nope it's still not working with the <form> code. Is there a way to allow the <form> html tag just to this buy links area.
I have even tried it like this:
Code:
<form action=\"https://www.paypal.com/cgi-bin/webscr" method=\"post\">
<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">
<input type=\"hidden\" name=\"business\" value=\"jamesdunford@soclan.co.uk\">
<input type=\"hidden\" name=\"item_name\" value=\"Ad-Zone Top\">
<input type=\"hidden\" name=\"item_number\" value=\"AD1\">
<input type=\"hidden\" name=\"amount\" value=\"10.00\">
<input type=\"hidden\" name=\"no_shipping\" value=\"1\">
<input type=\"hidden\" name=\"currency_code\" value=\"GBP\">
<input type=\"hidden\" name=\"lc\" value=\"GB\">
<input type=\"hidden\" name=\"bn\" value=\"PP-BuyNowBF\">
<input type=\"image\" src=\"https://www.paypal.com/en_GB/i/btn/btn_buynowCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"Make payments with PayPal - it's fast, free and secure!\">
<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_GB/i/scr/pixel.gif\" width=\"1\" height=\"1\">
</form>
|
But still no go!
Cheers for your help in this matter Gremmie its very much appreciated, as I am using this as my main advertising module and can't offer anything as they can't buy ahah it would be easier if paypal allowed a simple button but this is it unfortunatly.
DoC |
|
|
|
 |
Gremmie

|
Posted:
Fri Feb 22, 2008 9:20 pm |
|
What exactly doesn't work? I just entered your form data into a test plan I made and it worked, meaning the HTML was saved intact. Again, I don't know how to use this module though. |
|
|
|
 |
pdi-doc

|
Posted:
Fri Feb 22, 2008 9:44 pm |
|
man thats well odd, everytime i try and save that code nothing is saved...
I even done a test and just wrote some random words in the buy links area, saved and then checked out the module (plans & prices). Went back into admin and advertising and put the <form> data back into buy links area and saved. Went to the module (plans & prices) and the random words were still there... Are you using the standard advertising module that comes with RN2.20? If so can you send me your module to: jamesdunford@pd-inc.co.uk perhaps its just my files lol although I have not touched them apart from the above fix attempt. It's really odd
Cheers
DoC |
|
|
|
 |
Gremmie

|
Posted:
Fri Feb 22, 2008 9:58 pm |
|
I'm using the stock Advertising module in RN 2.20.0.
Do you know if magic quotes is on in your system?
I still think there is a bug where addslashes should be used. |
|
|
|
 |
pdi-doc

|
Posted:
Fri Feb 22, 2008 10:36 pm |
|
magic quotes? thats a new one to me mate, where can i find them and what do they do?
DoC
p.s I might not reply as I am going to bed as it's 4:36AM!!! & yes its coz im trying to get the plans & prices bit in the advertising module to work lol
DoC |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Sat Feb 23, 2008 4:11 am |
|
Don't know if this helps guys but there may be two seperate functions that need looking at. The one that 'adds' the initial prce plan and probably another that deals with 'editing' the plans. |
|
|
|
 |
|