| Author |
Message |
djrmenace |
|
Post subject: New block file (php) ruins theme when applied
Posted: Aug 28, 2008 - 02:34 PM
|
|
Joined: Aug 27, 2008
Posts: 10
Status: Offline
|
|
Hello,
I created a new block php file named block-Donations. Whenever I go in to the blocks section of the administration panel and load this block from file the theme dis-appears. In fact the entire website turns white and some un-clickable graphis show. The administration panel also does not show up hence I can not do anything.
it goes back to normal when I delete the block file from the blocks folder. I then go in to the blocks list and delete the entry for it from there also.
I am using standard code from php nuke to set up a paypal link:
(could the custom theme be causing an issue, should I be adding any code about the theme in the block? not sure what is going wrong)
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
$content = "Help keep our web site online with a donation!";
$content .= "form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
$content .= "input type=\"hidden\" name=\"cmd\" value=\"_xclick\">";
$content .= "input type=\"hidden\" name=\"business\" value=\"Myemailaddresswashere@whatever.com\">";
$content .= "input type=\"hidden\" name=\"item_name\" value=\"HordeCore Guild Donation\">";
$content .= "input type=\"hidden\" name=\"amount\" value=\"0\">";
$content .= "input type=\"hidden\" name=\"no_note\" value=\"0\">";
$content .= "input type=\"hidden\" name=\"currency_code\" value=\"USD\">";
$content .= "input type=\"hidden\" name=\"tax\" value=\"0\">";
$content .= "input type=\"image\" src=\"https://www.paypal.com/images/x-click-but04.gif\"
border=\"0\" name=\"submit\"
alt=\"Make payments with PayPal - it"s fast, free and secure!\">";
$content .= "/form>";
Let me know if you have seen this before.
Thank you,
Michael A.
[/code] |
|
|
| |
|
|
|
 |
mars |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 28, 2008 - 08:32 PM
|
|
Site Admin

Joined: Aug 15, 2004
Posts: 4277
Status: Offline
|
|
| Looks like you are missing the closing ?> at the end of the file? |
|
|
| |
|
|
|
 |
djrmenace |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 29, 2008 - 10:41 AM
|
|
Joined: Aug 27, 2008
Posts: 10
Status: Offline
|
|
I didn't paste it properly,
here is is:
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
$content = "Help keep our web site online with a donation!";
$content .= "form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
$content .= "input type=\"hidden\" name=\"cmd\" value=\"_xclick\">";
$content .= "input type=\"hidden\" name=\"business\" value=\"djrmenace@tpg.com.au\">";
$content .= "input type=\"hidden\" name=\"item_name\" value=\"HordeCore Guild Donation\">";
$content .= "input type=\"hidden\" name=\"amount\" value=\"0\">";
$content .= "input type=\"hidden\" name=\"no_note\" value=\"0\">";
$content .= "input type=\"hidden\" name=\"currency_code\" value=\"USD\">";
$content .= "input type=\"hidden\" name=\"tax\" value=\"0\">";
$content .= "input type=\"image\" src=\"https://www.paypal.com/images/x-click-but04.gif\"
border=\"0\" name=\"submit\"
alt=\"Make payments with PayPal - it"s fast, free and secure!\">";
$content .= "/form>";
?>
Thank you,
Michael A. |
|
|
| |
|
|
|
 |
mars |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 29, 2008 - 11:19 AM
|
|
Site Admin

Joined: Aug 15, 2004
Posts: 4277
Status: Offline
|
|
|
|
|
 |
djrmenace |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 29, 2008 - 03:52 PM
|
|
Joined: Aug 27, 2008
Posts: 10
Status: Offline
|
|
Thanks for the link,
I pasted in teh HTML from
http://www.phpnuke.org/modules.php?name=PHP-Nuke_HOWTO&page=paypal-block-for-php-nuke.html
Code:
Help keep our web site online with a donation!
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="My email">
<input type="hidden" name="item_name" value="My Homepage">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="image" src="https://www.paypal.com/images/x-click-but04.gif"
border="0"
name="submit" alt="Make payments with PayPal - it"s fast, free and secure!">
</form>
And it came up with:
Code:
<?php
#### Generated by Block Creator by Disipal Site (www.disipal.net) ###
if (eregi("block-Block_Creator.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "Help keep our web site online with a donation!";
$content .= "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
$content .= "<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">";
$content .= "<input type=\"hidden\" name=\"business\" value=\"My email\">";
$content .= "<input type=\"hidden\" name=\"item_name\" value=\"My Homepage\">";
$content .= "<input type=\"hidden\" name=\"amount\" value=\"10.00\">";
$content .= "<input type=\"hidden\" name=\"no_note\" value=\"1\">";
$content .= "<input type=\"hidden\" name=\"currency_code\" value=\"USD\">";
$content .= "<input type=\"hidden\" name=\"tax\" value=\"0\">";
$content .= "<input type=\"image\" src=\"https://www.paypal.com/images/x-click-but04.gif\" ";
$content .= " border=\"0\"";
$content .= "name=\"submit\" alt=\"Make payments with PayPal - it\"s fast, free and secure!\">";
$content .= "</form>";
$content .= "";
$content .= " ";
$content .= "
?>
However it still breaks the site. It actually looks liek more than the theme is broken, 80% of the images and content do not show on any page (even the pages that the new block is not meant to show on.
weird... |
|
|
| |
|
|
|
 |
djrmenace |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 29, 2008 - 03:57 PM
|
|
Joined: Aug 27, 2008
Posts: 10
Status: Offline
|
|
To add the the last post, I then tried adding a block php file which came with PHPnuke for "top ten links". The code looks very similar but it works fine and does not break the site.
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2006 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $prefix, $db;
$a = 1;
$result = $db->sql_query("SELECT lid, title FROM ".$prefix."_links_links ORDER BY hits DESC LIMIT 0,10");
while ($row = $db->sql_fetchrow($result)) {
$lid = intval($row['lid']);
$title = filter($row['title'], "nohtml");
$title2 = ereg_replace("_", " ", $title);
$content .= "<strong><big>·</big></strong> $a: <a href=\"modules.php?name=Web_Links&l_op=viewlinkdetails&lid=$lid&ttitle=$title\">$title2</a><br>";
$a++;
}
?>
|
|
|
| |
|
|
|
 |
mars |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 29, 2008 - 07:49 PM
|
|
Site Admin

Joined: Aug 15, 2004
Posts: 4277
Status: Offline
|
|
Try this, change the email address to your paypal email.
Name the file block-Donate.php
Code:
<?php
if (eregi("block-Donate.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
$content .= "input type=\"hidden\" name=\"cmd\" value=\"_donations\">";
$content .= "input type=\"hidden\" name=\"business\" value=\"YOUREMAIL.COM\">";
$content .= "input type=\"hidden\" name=\"item_name\" value=\"Our Site\">";
$content .= "input type=\"hidden\" name=\"no_shipping\" value=\"0\">";
$content .= "input type=\"hidden\" name=\"no_note\" value=\"1\">";
$content .= "input type=\"hidden\" name=\"currency_code\" value=\"USD\">";
$content .= "input type=\"hidden\" name=\"tax\" value=\"0\">";
$content .= "input type=\"hidden\" name=\"lc\" value=\"US\">";
$content .= "input type=\"hidden\" name=\"bn\" value=\"PP-DonationsBF\">";
$content .= "input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">";
$content .= "img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">";
$content .= "/form>";
?>
|
|
|
| |
|
|
|
 |
djrmenace |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 30, 2008 - 02:47 AM
|
|
Joined: Aug 27, 2008
Posts: 10
Status: Offline
|
|
OK, did that.
Good new and bad news:
Good = The site did not shit it's self.
Bad news = The Donate block is filled with code as text.
It is in the bottom left corner at
www.hordecore.net
the text showing is:
input type="hidden" name="cmd" value="_donations">input type="hidden" name="business" value="djrmenace@tpg.com.au">input type="hidden" name="item_name" value="Our Site">input type="hidden" name="no_shipping" value="0">input type="hidden" name="no_note" value="1">input type="hidden" name="currency_code" value="USD">input type="hidden" name="tax" value="0">input type="hidden" name="lc" value="US">input type="hidden" name="bn" value="PP-DonationsBF">input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">/form>
It might be tied in to whatever is causing my half of my HTML tags to not work on the fron page, they work fine in the custom forum I got from your warhammer2 theme but it is the from page of the site that it affected by something that is allowing some <IMG> tage, some <a hre>arguements are not allowed either like 'target=_blank' to open a link in a new window. I want make it unrestreicted and it doesn't seem to be my allowable html list (as per http://www.portalthemes.com/PNphpBB2-viewtopic-t-1828.phtml)
Let me know if you find anythingwrong with the code you gave me, if it works for you then I think my site is mis-behaving , thanks again for your continuing help. |
|
|
| |
|
|
|
 |
djrmenace |
|
Post subject: RE: New block file (php) ruins theme when applied
Posted: Aug 30, 2008 - 03:20 AM
|
|
Joined: Aug 27, 2008
Posts: 10
Status: Offline
|
|
Hi,
It is now working. I had to delete the old file from the blocks directory before it would let me add any new blocks (the create block button linked to paypal lol)
Here is the working code:
Code:
<?php
if (eregi("block-Donations2.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
$content = "Help keep our web site online with a donation!";
$content .= "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">";
$content .= "<input type=\"hidden\" name=\"cmd\" value=\"_xclick\">";
$content .= "<input type=\"hidden\" name=\"business\" value=\"gogamersadmin@gmail.com\">";
$content .= "<input type=\"hidden\" name=\"item_name\" value=\"Go Gamers.org\">";
$content .= "<input type=\"hidden\" name=\"no_note\" value=\"1\">";
$content .= "<input type=\"hidden\" name=\"currency_code\" value=\"USD\">";
$content .= "<input type=\"hidden\" name=\"tax\" value=\"0\">";
$content .= "<input type=\"hidden\" name=\"bn\" value=\"PP-DonationsBF\">";
$content .= "<input type=\"image\" src=\"http://www.gogamers.org/phpnuke/x-click-but20.gif\" border=\"0\" name=\"submit\" alt=\"Make payments with PayPal - it's fast, free and secure!\">";
$content .= "</form>";
?>
THANK YOU FOR YOUR HELP
Let me know if you know of any good general PHPNUKE forums that might be able to help me with:
http://www.portalthemes.com/PNphpBB2-viewtopic-t-1828.phtml |
|
|
| |
|
|
|
 |
|
|