Spoiler: [ Show ]
Spoiler: [ Hide ]
<?php
/***************************************************************************
* index_empty.php
* -------------------
* begin : 2007/04/12
* copyright : Mighty Gorgon
* website : http://www.mightygorgon.com
*
***************************************************************************/
/***************************************************************************
*
* 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, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/new_page_common.' . $phpEx);
echo "hello world";
?>
/***************************************************************************
* index_empty.php
* -------------------
* begin : 2007/04/12
* copyright : Mighty Gorgon
* website : http://www.mightygorgon.com
*
***************************************************************************/
/***************************************************************************
*
* 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, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/new_page_common.' . $phpEx);
echo "hello world";
?>
I tryed to add this simple php coded page and it shows exactlly what i wrote. Is there a way to put php into a block.
Im trying to add alot more complex php but i figured i would start with this to see if it even works.. Sorry i am new to icy pheonix but use phpbb3 and my own php web site. Im just getting ready to migrate to icy pheonix but there is alot of things i need to do that is php based.. Thanks for your help
Here is an example page from my current site.. this is a little more complex than hello world LOL
My donation page
Here is the code for that page
Spoiler: [ Show ]
Spoiler: [ Hide ]
<?
if($action == "record")
{
$record_donation="INSERT INTO donations(id,member,donation,month,year,method) VALUES ('NULL','$member','$donation','$month','$year','$method')";
mysql_query($record_donation);
}
if($action == "delete")
{
$deletedonation="DELETE from donations where id='$id'";
mysql_query($deletedonation);
}
$month_name = date("F");
$month_number = date("n");
$year_number = date("y");
echo "
<div align="center">
<p>
<font class="$classtitletext">Server Donation</font>
</p>
<p align="left">
<font class="$classmaintext">Our Counter-Strike server is hosted by <a class="$classlinktext" href="$csserverhostaddress" target="_blank">$csserverhostname</a> and costs $$csservercost each month. Our web server is hosted by <a class="$classlinktext" href="$webserverhostaddress" target="_blank">$webserverhostname</a> and costs $$webservercost each month. If you want to help pay for the servers put an amount in the box and click the Make Donation button at the bottom. If you want to send a check or money order, use the address provided and make the check or money order out to "$csserverdonationname". Thanks for being interested in helping us keep the server going!</font>
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="$csserverdonationemail">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="$siteaddress$vpath/server/PG-Donation_sent.php">
<input type="hidden" name="cancel_return" value="$siteaddress$vpath/server/PG-Donation_cancel.php">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="item_number" value="CS Server Donation">
<font class="$classmaintext">Payment Amount $ </font><input class="$classform" type="text" name="amount" size="10"><br>
<br>
<input type="submit" class="$classform" name="submit" value="Make Donation">
</form>
</p>
<p align="center">
<img src="$vpath/images/ccards.gif" border="0">
</p>
<p align="left">
<font class="$classmaintext">
Or you can send a check or money order made out to "$csserverdonationname" to:<br />
<br />
$csserverdonationname<br />
$csserverdonationadd<br />
$csserverdonationcity, $csserverdonationstate $csserverdonationzip<br />
</font>
</p>
<p align="center">
<br />
<a name="donations">
<hr>
<br />
<font class="$classtitletext">Record of Donations</font><br />
<table border="1" cellspacing="0" cellpadding="3" bordercolor="$colormaintable" width="75%">
";
if(!$order_by)
{
$order_by = "total";
$desc = "DESC";
}
if($order_by == "username")
{
echo "<tr>
<td bgcolor="$colormaintable" align="center">
";
if($desc == "DESC")
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username#donations">Name</a>";
}
else
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username&desc=DESC#donations">Name</a>";
}
echo " </td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total&desc=DESC#donations">Total Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count&desc=DESC#donations">Times Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
<font class="$classboxtitletext">Last Donation</font>
</td>
</tr>
";
}
elseif($order_by == "total")
{
echo "<tr>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username#donations">Name</a>
</td>
<td bgcolor="$colormaintable" align="center">
";
if($desc == "DESC")
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total#donations">Total Donated</a>";
}
else
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total&desc=DESC#donations">Total Donated</a>";
}
echo " </td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count&desc=DESC#donations">Times Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
<font class="$classboxtitletext">Last Donation</font>
</td>
</tr>
";
}
else
{
echo "<tr>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username#donations">Name</a>
</td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total&desc=DESC#donations">Total Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
";
if($desc == "DESC")
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count#donations">Times Donated</a>";
}
else
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count&desc=DESC#donations">Times Donated</a>";
}
echo " </td>
<td bgcolor="$colormaintable" align="center">
<font class="$classboxtitletext">Last Donation</font>
</td>
</tr>
";
}
$month_name = date("F");
$year_name = date("y");
$totaldonations = 0;
$totaldonationtimes = 0;
$currentmember = "";
$currentmemberdonations = 0;
$currentdonationscount = 0;
$findmoney=mysql_query("SELECT users.*, donations.*, SUM(donations.donation) AS total, COUNT(donations.donation) AS count FROM donations JOIN users WHERE donations.member=users.id GROUP BY member ORDER BY $order_by $desc");
while($foundmoney=mysql_fetch_array($findmoney))
{
$findlastdonation=mysql_query("SELECT month,year FROM donations WHERE member=$foundmoney[member]");
while($foundlastdonation=mysql_fetch_array($findlastdonation))
{
$lastdonationmonth = $foundlastdonation[month];
$lastdonationyear = $foundlastdonation[year];
}
$totaldonations = $totaldonations + $foundmoney[total];
$totaldonationtimes = $totaldonationtimes + $foundmoney[count];
$totalexpenses = ($year_number - 1);
$totalexpenses = $totalexpenses * 12;
$totalexpenses = $totalexpenses - 9;
$totalexpenses = $totalexpenses + $month_number;
$totalexpenses = $totalexpenses * ($csservercost + $webservercost);
$totaldifference = $totalexpenses - $totaldonations;
if(($founduser[position] != "retired") && ($founduser[position] != "nonmember"))
{
$user_position = "member";
}
else
{
$user_position = $founduser[position];
}
echo "
<tr>
<td>
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=roster/PG-View&menu=Roster&type=$user_position&member=$foundmoney[member]">$foundmoney[username]</a>
</td>
<td align="right">
<font class="$classmaintext">$$foundmoney[total]</font>
</td>
<td align="right">
<font class="$classmaintext">$foundmoney[count]</font>
</td>
<td align="right">
";
if(($lastdonationmonth == $month_name) && ($lastdonationyear == $year_name))
{
echo " <font class="$classlabeltextbold">$lastdonationmonth 20$lastdonationyear</font>";
}
else
{
echo " <font class="$colormaintext">$lastdonationmonth $lastdonationyear</font>";
}
echo "
</td>
</tr>
";
}
echo " <tr>
<td bgcolor="$colormaintable">
<font class="$classboxtitletext">Total Donations</font>
</td>
<td bgcolor="$colormainbackground" align="right">
<font class="$classmaintext">$$totaldonations</font>
</td>
<td bgcolor="$colormainbackground" align="right">
<font class="$classmaintext">$totaldonationtimes</font>
</td>
<td bgcolor="$colormaintable">
</td>
</tr>
</table>
</p>
</div>
<br />
";
if($user[level] > 6)
{
echo "
<div align="center">
<form action="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server" method="POST">
<table border="0" cellspacing="0" cellpadding="3" width="200">
<tr>
<td bgcolor="$colormaintable" rowspan="7" align="center">
</td>
<td bgcolor="$colormaintable" colspan="3" align="center">
<font class="$classboxtitletext">Record New Donation</font>
</td>
<td bgcolor="$colormaintable" rowspan="7" align="center">
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Name</font>
</td>
<td width="10">
</td>
<td>
<select class="$classform" name="member">
<option value="0">Unknown</option>
";
$findmember=mysql_query("SELECT * FROM users ORDER BY username");
while($foundmember=mysql_fetch_array($findmember))
{
echo "<option value="$foundmember[id]">$foundmember[username]</option>";
}
echo "
</select>
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Donation</fpnt>
</td>
<td width="10">
</td>
<td>
<input class="$classform" type="text" name="donation" size="5">
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Month</font>
</td>
<td width="10">
</td>
<td>
<select class="$classform" name="month">
<option>$month_name</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Year</font>
</td>
<td width="10">
</td>
<td>
<input class="$classform" type="text" name="year" value="$year_number" size="2">
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Method</font>
</td>
<td width="10">
</td>
<td>
<select class="$classform" name="method">
<option>PayPal</option>
<option>Credit Card</option>
<option>Check</option>
<option>Cash</option>
</select>
</td>
</tr>
<tr>
<td bgcolor="$colormaintable" colspan="3" align="center">
<input type="hidden" name="action" value="record">
<input class="$classform" type="Submit" value="Record Donation">
</td>
</tr>
</table>
</form>
";
}
?>
if($action == "record")
{
$record_donation="INSERT INTO donations(id,member,donation,month,year,method) VALUES ('NULL','$member','$donation','$month','$year','$method')";
mysql_query($record_donation);
}
if($action == "delete")
{
$deletedonation="DELETE from donations where id='$id'";
mysql_query($deletedonation);
}
$month_name = date("F");
$month_number = date("n");
$year_number = date("y");
echo "
<div align="center">
<p>
<font class="$classtitletext">Server Donation</font>
</p>
<p align="left">
<font class="$classmaintext">Our Counter-Strike server is hosted by <a class="$classlinktext" href="$csserverhostaddress" target="_blank">$csserverhostname</a> and costs $$csservercost each month. Our web server is hosted by <a class="$classlinktext" href="$webserverhostaddress" target="_blank">$webserverhostname</a> and costs $$webservercost each month. If you want to help pay for the servers put an amount in the box and click the Make Donation button at the bottom. If you want to send a check or money order, use the address provided and make the check or money order out to "$csserverdonationname". Thanks for being interested in helping us keep the server going!</font>
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="$csserverdonationemail">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="$siteaddress$vpath/server/PG-Donation_sent.php">
<input type="hidden" name="cancel_return" value="$siteaddress$vpath/server/PG-Donation_cancel.php">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="item_number" value="CS Server Donation">
<font class="$classmaintext">Payment Amount $ </font><input class="$classform" type="text" name="amount" size="10"><br>
<br>
<input type="submit" class="$classform" name="submit" value="Make Donation">
</form>
</p>
<p align="center">
<img src="$vpath/images/ccards.gif" border="0">
</p>
<p align="left">
<font class="$classmaintext">
Or you can send a check or money order made out to "$csserverdonationname" to:<br />
<br />
$csserverdonationname<br />
$csserverdonationadd<br />
$csserverdonationcity, $csserverdonationstate $csserverdonationzip<br />
</font>
</p>
<p align="center">
<br />
<a name="donations">
<hr>
<br />
<font class="$classtitletext">Record of Donations</font><br />
<table border="1" cellspacing="0" cellpadding="3" bordercolor="$colormaintable" width="75%">
";
if(!$order_by)
{
$order_by = "total";
$desc = "DESC";
}
if($order_by == "username")
{
echo "<tr>
<td bgcolor="$colormaintable" align="center">
";
if($desc == "DESC")
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username#donations">Name</a>";
}
else
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username&desc=DESC#donations">Name</a>";
}
echo " </td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total&desc=DESC#donations">Total Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count&desc=DESC#donations">Times Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
<font class="$classboxtitletext">Last Donation</font>
</td>
</tr>
";
}
elseif($order_by == "total")
{
echo "<tr>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username#donations">Name</a>
</td>
<td bgcolor="$colormaintable" align="center">
";
if($desc == "DESC")
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total#donations">Total Donated</a>";
}
else
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total&desc=DESC#donations">Total Donated</a>";
}
echo " </td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count&desc=DESC#donations">Times Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
<font class="$classboxtitletext">Last Donation</font>
</td>
</tr>
";
}
else
{
echo "<tr>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=username#donations">Name</a>
</td>
<td bgcolor="$colormaintable" align="center">
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=total&desc=DESC#donations">Total Donated</a>
</td>
<td bgcolor="$colormaintable" align="center">
";
if($desc == "DESC")
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count#donations">Times Donated</a>";
}
else
{
echo " <a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server&order_by=count&desc=DESC#donations">Times Donated</a>";
}
echo " </td>
<td bgcolor="$colormaintable" align="center">
<font class="$classboxtitletext">Last Donation</font>
</td>
</tr>
";
}
$month_name = date("F");
$year_name = date("y");
$totaldonations = 0;
$totaldonationtimes = 0;
$currentmember = "";
$currentmemberdonations = 0;
$currentdonationscount = 0;
$findmoney=mysql_query("SELECT users.*, donations.*, SUM(donations.donation) AS total, COUNT(donations.donation) AS count FROM donations JOIN users WHERE donations.member=users.id GROUP BY member ORDER BY $order_by $desc");
while($foundmoney=mysql_fetch_array($findmoney))
{
$findlastdonation=mysql_query("SELECT month,year FROM donations WHERE member=$foundmoney[member]");
while($foundlastdonation=mysql_fetch_array($findlastdonation))
{
$lastdonationmonth = $foundlastdonation[month];
$lastdonationyear = $foundlastdonation[year];
}
$totaldonations = $totaldonations + $foundmoney[total];
$totaldonationtimes = $totaldonationtimes + $foundmoney[count];
$totalexpenses = ($year_number - 1);
$totalexpenses = $totalexpenses * 12;
$totalexpenses = $totalexpenses - 9;
$totalexpenses = $totalexpenses + $month_number;
$totalexpenses = $totalexpenses * ($csservercost + $webservercost);
$totaldifference = $totalexpenses - $totaldonations;
if(($founduser[position] != "retired") && ($founduser[position] != "nonmember"))
{
$user_position = "member";
}
else
{
$user_position = $founduser[position];
}
echo "
<tr>
<td>
<a class="$classlinktext" href="$siteaddress$vpath/Page.php?page=roster/PG-View&menu=Roster&type=$user_position&member=$foundmoney[member]">$foundmoney[username]</a>
</td>
<td align="right">
<font class="$classmaintext">$$foundmoney[total]</font>
</td>
<td align="right">
<font class="$classmaintext">$foundmoney[count]</font>
</td>
<td align="right">
";
if(($lastdonationmonth == $month_name) && ($lastdonationyear == $year_name))
{
echo " <font class="$classlabeltextbold">$lastdonationmonth 20$lastdonationyear</font>";
}
else
{
echo " <font class="$colormaintext">$lastdonationmonth $lastdonationyear</font>";
}
echo "
</td>
</tr>
";
}
echo " <tr>
<td bgcolor="$colormaintable">
<font class="$classboxtitletext">Total Donations</font>
</td>
<td bgcolor="$colormainbackground" align="right">
<font class="$classmaintext">$$totaldonations</font>
</td>
<td bgcolor="$colormainbackground" align="right">
<font class="$classmaintext">$totaldonationtimes</font>
</td>
<td bgcolor="$colormaintable">
</td>
</tr>
</table>
</p>
</div>
<br />
";
if($user[level] > 6)
{
echo "
<div align="center">
<form action="$siteaddress$vpath/Page.php?page=server/PG-Donation&menu=Server" method="POST">
<table border="0" cellspacing="0" cellpadding="3" width="200">
<tr>
<td bgcolor="$colormaintable" rowspan="7" align="center">
</td>
<td bgcolor="$colormaintable" colspan="3" align="center">
<font class="$classboxtitletext">Record New Donation</font>
</td>
<td bgcolor="$colormaintable" rowspan="7" align="center">
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Name</font>
</td>
<td width="10">
</td>
<td>
<select class="$classform" name="member">
<option value="0">Unknown</option>
";
$findmember=mysql_query("SELECT * FROM users ORDER BY username");
while($foundmember=mysql_fetch_array($findmember))
{
echo "<option value="$foundmember[id]">$foundmember[username]</option>";
}
echo "
</select>
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Donation</fpnt>
</td>
<td width="10">
</td>
<td>
<input class="$classform" type="text" name="donation" size="5">
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Month</font>
</td>
<td width="10">
</td>
<td>
<select class="$classform" name="month">
<option>$month_name</option>
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Year</font>
</td>
<td width="10">
</td>
<td>
<input class="$classform" type="text" name="year" value="$year_number" size="2">
</td>
</tr>
<tr>
<td>
<font class="$classmaintext">Method</font>
</td>
<td width="10">
</td>
<td>
<select class="$classform" name="method">
<option>PayPal</option>
<option>Credit Card</option>
<option>Check</option>
<option>Cash</option>
</select>
</td>
</tr>
<tr>
<td bgcolor="$colormaintable" colspan="3" align="center">
<input type="hidden" name="action" value="record">
<input class="$classform" type="Submit" value="Record Donation">
</td>
</tr>
</table>
</form>
";
}
?>