Jump to content

vigiw

Members
  • Posts

    100
  • Joined

  • Last visited

    Never

Everything posted by vigiw

  1. Hello, I would like to know if it would be possible to have an image with hyperlink hotspots on different parts of it (to different destinations).. and these hotspots would be used to enter in data into a form field on that page. For example: There is a map of a state.  There is a north and a south hotspot.  If I click a certain area of the image and it happens to be north (State), could there be a text form field that would have data automatically entered into it on-click?  Like, when I click this area all of a sudden in this form field it says "Northern Ohio"? (if Ohio were to be this state) This would really come in handy on my website.. any help appreciated. Thanks in advance!! ;D
  2. [Bump] For help.. please help out, I am stuck.. thanks in advance!
  3. Hi everyone, and Happy Thanksgiving! ;D I am currently improving a system I successfully installed on my website, thanks largely in part to phpfreaks for the help!  But now I am adding more to it and I will try to "spice it up" a bit. I have an HTML page of what I want it to look like--at least, that was the plan before PHP--but I want to keep it as similar as possible. Example page code (quite a bit, but quite simply an HTML page with colors, fonts, tables with cell colors, etc.): [code]<html> <head> <meta http-equiv="Content-Language" content="en-us"> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Vigilant Weather - Alert Mode Analysis</title> </head> <body> <p align="center"><b><font face="Verdana" size="4" color="#0000FF">Vigilant Weather - Alert Mode Analysis</font></b></p> <p align="center"><font face="Verdana" size="2">Vigilant Weather Alert Mode Analysis will show you the live breakdown of storms that we may consider for Alert Mode.&nbsp; To find out if a particular storm has caused Alert Mode to be issued, please refer to the Severe Weather Forum at <a href="http://www.vigilantweather.com">www.vigilantweather.com</a></font></p> <p align="center"><b><font face="Verdana" size="4">Potential Upcoming Storms:</font></b></p> <table border="1" width="100%" id="table3">   <tr>     <td align="center">     <p align="center"><font face="Verdana">Storm ID</font></td>     <td align="center"><font face="Verdana">Status<sup><font size="1">§</font></sup></font></td>     <td align="center"><font face="Verdana">Updated</font></td>     <td align="center"><font face="Verdana">Valid On</font></td>     <td align="center" width="223"><font face="Verdana">Conditions</font></td>     <td align="center" width="245"><font face="Verdana">Location</font></td>     <td align="center" width="184"><font face="Verdana">Likelihood*</font></td>     <td align="center"><font face="Arial">Risk**</font></td>     <td align="center"><font face="Arial">Alert Mode Consideration<sup><font size="1">±</font></sup></font></td>   </tr>   <tr>     <td align="center" bgcolor="#FF0000"><font face="Arial" color="#FFFFFF">1</font></td>     <td align="center" bgcolor="#FF0000"><font face="Arial" color="#FFFFFF">     ACTIVE</font></td>     <td align="center" bgcolor="#FF0000"><font face="Arial" color="#FFFFFF">7-27-06</font></td>     <td align="center" bgcolor="#FF0000"><font face="Arial" color="#FFFFFF">7-28-06</font></td>     <td align="center" bgcolor="#FF0000" width="223">     <font face="Arial" color="#FFFFFF">SCATTERED SEVERE THUNDERSTORMS</font></td>     <td align="center" bgcolor="#FF0000" width="245">     <font face="Arial" color="#FFFFFF">SOUTHERN NEW ENGLAND</font></td>     <td align="center" bgcolor="#FF0000" width="184">     <font face="Arial" color="#FFFFFF">LIKELY</font></td>     <td align="center" bgcolor="#FF0000"><font face="Arial" color="#FFFFFF">     MODERATE</font></td>     <td align="center" bgcolor="#FF0000"><font face="Arial" color="#FFFFFF">IN     CONSIDERATION</font></td>   </tr>   <tr>     <td align="center"><font face="Arial">2</font></td>     <td align="center"><font face="Arial">INACTIVE</font></td>     <td align="center">&nbsp;</td>     <td align="center">&nbsp;</td>     <td align="center" width="223">     &nbsp;</td>     <td align="center" width="245">     &nbsp;</td>     <td align="center" width="184">     &nbsp;</td>     <td align="center">&nbsp;</td>     <td align="center">&nbsp;</td>   </tr>   <tr>     <td align="center"><font face="Arial">3</font></td>     <td align="center"><font face="Arial">INACTIVE</font></td>     <td align="center">&nbsp;</td>     <td align="center">&nbsp;</td>     <td align="center" width="223">     &nbsp;</td>     <td align="center" width="245">     &nbsp;</td>     <td align="center" width="184">     &nbsp;</td>     <td align="center">&nbsp;</td>     <td align="center">&nbsp;</td>   </tr>   <tr>     <td align="center"><font face="Arial">4</font></td>     <td align="center"><font face="Arial">INACTIVE</font></td>     <td align="center">&nbsp;</td>     <td align="center">&nbsp;</td>     <td align="center" width="223">&nbsp;</td>     <td align="center" width="245">&nbsp;</td>     <td align="center" width="184">&nbsp;</td>     <td align="center">&nbsp;</td>     <td align="center">&nbsp;</td>   </tr> </table> <p><font face="Verdana"><sup><font size="1">§</font></sup>Status is represented by &quot;Inactive&quot; when the storm is no longer being watched, &quot;Active&quot; when the storm is currently being watched, and &quot;Watching&quot; the storm will be watched in the future (for storms coming within days, not hours, etc.)&nbsp; &quot;Active&quot; is represented by red, &quot;Inactive&quot; by white, and &quot;Watching&quot; by light blue.&nbsp; When in &quot;Inactive&quot; mode, there may be obsolete tables for Storm IDs that are inactive on the bottom of this page, please ignore them and use the active one(s).</font></p> <p><font face="Verdana">*Likelihood has 4 possible forecasts, ranging from least severe to most severe: &quot;Threat&quot;, &quot;Possible&quot;, &quot;Likely&quot;, and &quot;Very Likely&quot;.&nbsp; At times we may mix multiple forecasts that are 'in between', for example: &quot;Possible-Likely&quot;.&nbsp; Likelihood shows the probability of a particular storm striking a particular area.</font></p> <p><font face="Verdana">**Risk has 4 possible forecasts, ranging from least severe to most severe: &quot;Low&quot;, &quot;Moderate&quot;, &quot;High&quot;, and &quot;Extreme&quot;.&nbsp; At times we may mix multiple forecasts that are 'in between', for example: &quot;Low-Moderate&quot;.&nbsp; Risk shows how dangerous a particular storm can be; considering the storm will hit, we will show you the potential risk the storm will have.</font></p> <p><font face="Verdana"><sup><font size="1">±</font></sup>Alert Mode Consideration has 5 possible outputs explaining the likelihood of Vigilant Weather issuing Alert Mode for a particular storm.&nbsp; Ranging from least likely to most likely, the 5 possible outputs are: &quot;Unlikely&quot;, &quot;Possible&quot;, &quot;In Consideration&quot;, &quot;Likely&quot;, and &quot;Very Likely&quot;.&nbsp; Note that &quot;In Consideration&quot; means we are considering a particular storm for Alert Mode, but it is between &quot;Possible&quot; and &quot;Likely&quot;.</font></p> <hr> <p align="center"><b><font face="Verdana">The Breakdown:</font></b></p> <p align="left"><i><font face="Verdana">Note: Active forecasts, such as &quot;Threat&quot; are highlighted in yellow.&nbsp;&nbsp; At times, if we feel forecasts are 'in between', for example, a forecast may be in between &quot;Likely&quot; and &quot;Very Likely&quot;, so we will highlight both under the specific forecast, such as &quot;Tornadoes&quot;.&nbsp; (Note that N/A designates to little a chance of happening.) Once again, likelihood is the chance of something occurring a particular storm, such as hail; risk is how dangerous we feel something, such as wind damage, will be in a particular storm.</font></i></p> <p>&nbsp;</p> <table border="2" width="100%" id="table2" bordercolor="#FF00FF">   <tr>     <td bgcolor="#00FFFF">     <p align="center"><b><font face="Verdana" size="4">VALID: Storm ID #1 -     Likelihood</font></b></td>   </tr> </table> <table border="2" width="100%" id="table1" bordercolor="#FF00FF">   <tr>     <td align="center" height="23"><b><font face="Verdana">Tornadoes</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Hail</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Wind Damage</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Heavy Rainfall</font></b></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Likely</font></td>     <td align="center"><font face="Verdana">Likely</font></td>     <td align="center"><font face="Verdana">Likely</font></td>     <td align="center"><font face="Verdana">Likely</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Possible</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Possible</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Possible</font></td>     <td align="center"><font face="Verdana">Possible</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Threat</font></td>     <td align="center"><font face="Verdana">Threat</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Threat</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Threat</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>   </tr> </table> <table border="2" width="100%" id="table6" bordercolor="#FF0000">   <tr>     <td bgcolor="#00FFFF">     <p align="center"><b><font face="Verdana" size="4">VALID: Storm ID #1 - Risk</font></b></td>   </tr> </table> <table border="2" width="100%" id="table7" bordercolor="#FF0000">   <tr>     <td align="center" height="23"><b><font face="Verdana">Tornadoes</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Hail</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Wind Damage</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Rainfall</font></b></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Moderate</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Moderate</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Moderate</font></td>     <td align="center"><font face="Verdana">Moderate</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFFFF"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFFFF"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>   </tr> </table> <hr> <table border="2" width="100%" id="table12" bordercolor="#FF00FF">   <tr>     <td bgcolor="#00FFFF">     <p align="center"><b><font face="Verdana" size="4">VALID: Storm ID #2 -     Likelihood</font></b></td>   </tr> </table> <table border="2" width="100%" id="table13" bordercolor="#FF00FF">   <tr>     <td align="center" height="23"><b><font face="Verdana">Tornadoes</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Hail</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Wind Damage</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Heavy Rainfall</font></b></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Likely</font></td>     <td align="center"><font face="Verdana">Likely</font></td>     <td align="center" bgcolor="#FFFFFF"><font face="Verdana">Likely</font></td>     <td align="center"><font face="Verdana">Likely</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Possible</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Possible</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Possible</font></td>     <td align="center"><font face="Verdana">Possible</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Threat</font></td>     <td align="center"><font face="Verdana">Threat</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Threat</font></td>     <td align="center"><font face="Verdana">Threat</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>   </tr> </table> <table border="2" width="100%" id="table14" bordercolor="#FF0000">   <tr>     <td bgcolor="#00FFFF">     <p align="center"><b><font face="Verdana" size="4">VALID: Storm ID #2 - Risk</font></b></td>   </tr> </table> <table border="2" width="100%" id="table15" bordercolor="#FF0000">   <tr>     <td align="center" height="23"><b><font face="Verdana">Tornadoes</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Hail</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Wind Damage</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Rainfall</font></b></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Moderate</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Moderate</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Moderate</font></td>     <td align="center"><font face="Verdana">Moderate</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>     <td align="center"><font face="Verdana">Low</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>   </tr> </table> <hr> <table border="2" width="100%" id="table20" bordercolor="#FF00FF">   <tr>     <td bgcolor="#00FFFF">     <p align="center"><b><font face="Verdana" size="4">VALID: Storm ID #3 -     Likelihood</font></b></td>   </tr> </table> <table border="2" width="100%" id="table21" bordercolor="#FF00FF">   <tr>     <td align="center" height="23"><b><font face="Verdana">Tornadoes</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Hail</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Wind Damage</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Heavy Rainfall</font></b></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>     <td align="center"><font face="Verdana">Very Likely</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Likely</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Likely</font></td>     <td align="center" bgcolor="#FFFFFF"><font face="Verdana">Likely</font></td>     <td align="center"><font face="Verdana">Likely</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Possible</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Possible</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Possible</font></td>     <td align="center"><font face="Verdana">Possible</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Threat</font></td>     <td align="center"><font face="Verdana">Threat</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Threat</font></td>     <td align="center"><font face="Verdana">Threat</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>   </tr> </table> <table border="2" width="100%" id="table22" bordercolor="#FF0000">   <tr>     <td bgcolor="#00FFFF">     <p align="center"><b><font face="Verdana" size="4">VALID: Storm ID #3 - Risk</font></b></td>   </tr> </table> <table border="2" width="100%" id="table23" bordercolor="#FF0000">   <tr>     <td align="center" height="23"><b><font face="Verdana">Tornadoes</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Hail</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Wind Damage</font></b></td>     <td align="center" height="23"><b><font face="Verdana">Rainfall</font></b></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>     <td align="center"><font face="Verdana">Very High</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>     <td align="center"><font face="Verdana">High</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">Moderate</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Moderate</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Moderate</font></td>     <td align="center"><font face="Verdana">Moderate</font></td>   </tr>   <tr>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFFFF"><font face="Verdana">Low</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">Low</font></td>     <td align="center"><font face="Verdana">Low</font></td>   </tr>   <tr>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center"><font face="Verdana">N/A</font></td>     <td align="center" bgcolor="#FFFF00"><font face="Verdana">N/A</font></td>   </tr> </table> <hr> <p><b><font face="Arial" size="2">NOTICE: All content on this page has been created by and is maintained &amp; updated by Vigilant Weather - <a href="http://www.vigilantweather.com">www.vigilantweather.com</a> and may not be redistributed, reproduced, rewritten, or republished in anyway without written permission by Eddie stating otherwise.&nbsp; All content on this page is <u>not</u> to be used as a serious decision to save life/lives or property.&nbsp; Any damages or losses potentially or completely caused by any or all of the content on this page does not put any Vigilant Weather staff member at fault.&nbsp; This page is to be used a simple reference or guidance, and only this.</font></b></p> </body> </html> [/code] And I want to somehow incorporate a PHP query page (which is working with my database already--this one is just an example), which will look similar to this, but with different queries and echo text and whatnot: [code]<? include("bos_header.php"); include("bos_db3.php"); $q = mysql_query("SELECT * from `" . $table_name . "`"); while($row = mysql_fetch_assoc($q)) { echo "Zone 3 - In MA: Essex, Suffolk, Middlesex counties, In NH: Rockingham, Hillsborough counties<br><br>Last Updated: " . $row['time'] . " PST<br><br>Day 1:<br><br>" . $row['heaviness1'] . " " . $row['precip1'] . " , with " . $row['conditions_1'] . " " . $row['conditions2_1'] . " conditions.  High " . $row['high1'] . ", Low <br>" . $row['low1'] . ".  Winds "  . $row['winddir1'] . " at " . $row['wind1'] . " mph.  Probability of Precipitation: "  . $row['pop1'] . "<br><br>Day 2:<br><br>" . $row['heaviness2'] . " " . $row['precip2'] . " , with " . $row['conditions_2'] . " " . $row['conditions2_2'] . " conditions.  High " . $row['high2'] . ", Low <br>" . $row['low2'] . ".  Winds "  . $row['winddir2'] . " at " . $row['wind2'] . " mph.  Probability of Precipitation: "  . $row['pop2'] . "<br><br>Day 3:<br><br>" . $row['heaviness3'] . " " . $row['precip3'] . " , with " . $row['conditions_3'] . " " . $row['conditions2_3'] . " conditions.  High " . $row['high3'] . ", Low <br>" . $row['low3'] . ".  Winds "  . $row['winddir3'] . " at " . $row['wind3'] . " mph.  Probability of Precipitation: "  . $row['pop3'] . "<br><br>Day 4:<br><br>" . $row['heaviness4'] . " " . $row['precip4'] . " , with " . $row['conditions_4'] . " " . $row['conditions2_4'] . " conditions.  High " . $row['high4'] . ", Low <br>" . $row['low4'] . ".  Winds "  . $row['winddir4'] . " at " . $row['wind4'] . " mph.  Probability of Precipitation: "  . $row['pop4'] . "<br><br>Day 5:<br><br>" . $row['heaviness5'] . " " . $row['precip5'] . " , with " . $row['conditions_5'] . " " . $row['conditions2_5'] . " conditions.  High " . $row['high5'] . ", Low <br>" . $row['low5'] . ".  Winds "  . $row['winddir5'] . " at " . $row['wind5'] . " mph.  Probability of Precipitation: "  . $row['pop5'] . "<br>______________________________________________<br>"; } if(mysql_num_rows($q) < 1) { echo "There are no forecasts updated by BOS at this time."; } mysql_close(); //closes the link to mysql ?>[/code] If you are confused, here is the system in a nutshell: It is a weather alert & forecast system, the forecaster submits both alerts and forecasts via a working form to a working database (this part is done).. I would like to use the same frameworks to produce a new forecaster form (no problem to make), but here's my question: How do I make it so the data sent to the database (similar to PHP code page--2nd code) will be able to show up on the different tables (different data corresponds with different tables) in the correct cells, with the correct alert colors, etc. (Ex: An active storm will be red..) I may have to do away with this PHP code I realize, but how do I do this successfully? Feel free to ask questions if you need further information. Please help, I am in quite a predicament! Thanks, and happy holidays! :)
  4. Ok I'll see if it works.... Also, Is there a way to edit my submit file so I can also have a minutes field? Here is the beginning of my code for my submit file, I am only going to display the relevant lines: [code]strtotime("+ " . $_POST['field5'] . " hours"); $field5 = date("Y-m-d G:i:s", strtotime("+ " . $_POST['field5'] . " hours"));[/code] field5 is the field that the user enters the amount of hours in and has the expiration date/time/etc. in it. Thank you!
  5. Since Crons may not be enough.. is there a way to make this file available in public_html so I can run it in my browser?  I tried that but it is just a blank page. Suggestions? Thanks!
  6. For Cron Jobs for "Hour" I am able to select an hour from 0-23, there is no "all".  There is no "minute" field.  There is only hour and day by day of week.  Monday-Sunday, with an additonal "all".  So the most I can do it is every 24 hours. >:( Is there a way to do it other than using the control panel? Also: When I edit the necessary field names and database login information below, will this be all I need for the script file to run properly? <? $currentdate = date("Y-m-d H:i:s"); $databaseconnection = mysql_connect ("$HOST", "$USERNAME", "$PASSWORD") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("$DATABASENAME"); $querystring = "DELETE from <Database Table> where <expiry date field name> <= '$currentdate'"; $result = mysql_query("$querystring"); ?> Thanks!
  7. Thanks for all of your help, everyone!  I figured out how to do the hour thing.  I based it off of sanfly's script, I just had to adjust some things. ;D But, yes, my server does allow Cron Jobs.  However, I have never used them and do not know how to.  Unfortunately my control panel is really not extensive.  My CP is vDeck and when I click Cron Jobs it tells me to type in the script path from /home and it allows me to select a day the script can run and the time.  For days, I can click all, but for times I can only select one time. I would be interested in erasing all old data as soon and as much as possible.  Could you please explain to me how this can be done-- to a beginner? :-[ Thanks! ;D
  8. Ok thank you!! One issue-- this is working but I think this is the line that needs to be changed: $expiry_datetime = date("Y-m-d G:i:s", strtotime("+ 6 hours")); That works, it makes the expire time +6 hours, but how can I make it not be 6, but whatever the user defines in the field? Thanks again!
  9. Hello, I would like to improve my current method of using and expiring data sent to my MySQL database using PHP forms.  I am running a weather forecast & weather alerts system.  Currently the forecaster (person submitting the forms) has to manually type in the time of expiration, using the MySQL TIMESTAMP format: YYYY-MM-DD HH:mm:ss I will run a query in phpMyAdmin from time to time to hunt down rows of data that have already expired, and those that have already expired, using the correct format, will be erased using this query.  That is working.  However, am I able to allow the user to put in a number for this field, such as "6".  And this will allow the data to expire in 6 hours, or however many hours the user has set it to? If I can do this, please explain how, because this would be a wonderful upgrade. Thank you!  If you have more questions about what I mean, I will gladly answer them here. ;D
  10. Ok thank you and sorry for the late reply here, but how do I make the following script: DELETE FROM alerts WHERE expiretime < NOW() use multiple tables such as: alerts alerts2 alerts3 Thanks!
  11. Ok Thanks.. Is there a way to make this script automatic?  Maybe cron jobs? I honestly do not know what a cron job is and have never used one so I would not know what to do. It seems very tedious running this every so often since there will be quite the amount of alerts to empty when needed.
  12. No, I don't want to delete tables.  I was just verifying that it only empties the data that I want it to, and not deleting. I have a weather forecast system, it officially launched to the public last night.  I have different forecast areas and different alert types and so they are in their own tables of one database.  It is already working, the hard part is over.  I just want the old data to be removed. I have another question: What format does the expiretime have to be in? Date, Time, maybe, I don't know the exact format to make the database understand. Thanks.
  13. Ok.. I have many tables in this database that contain this data that need to be emptied.  Do I have to name each table in there or the database name, or what? Thanks. ;D
  14. Hello, I have a working PHP form that sends data to my MySQL database.  It is used for a weather alert system.  One of the fields in the form & database is an expiration field.  It shows the user when the alert will expire.  Is there a way to auto-delete just the data sent with that form when it is supposed to expire?  I have many weather alerts and I would like them to be emptied from the database when it is needed. Please help, this is a much needed feature.  All help appreciated :) Thank you so much!
  15. Well-- to Ken: I replaced that code with the code that was mentioned before your post by Ray. I took off the <? php tags because from what I understood, I should have replaced your version of that line with mine. And now I get the following error: Parse error: parse error, unexpected T_ELSEIF in /public_html/forecast/forecast/submit.php on line 157 Here's line 157: elseif($_GET['success'] == "yes") { //what to do if $_GET['success'] does equal yes But it has to be due to the code you supplied... ahh what a day! Thanks for your help so far! ;D I'll check my field names, any help still appreciated!
  16. Thanks Ray, this is what I see: Column count doesn't match value count at row 1 Any ideas? Thanks again!
  17. No, the paths ARE set up... it is all correct with the db.php file. I am confident in saying that I am at or very close to 100% sure that it is in the code of the file. I do not know what is wrong and need to fix it but do not know how to. Thanks for your responses, but any ideas now? Thanks again.
  18. It is there... like I said, one example (floodwatch) works, the other does not.  db.php is included and the database/table, etc. is setup.
  19. Hi Ken, Thanks for replying... take a look at this example: http://www.vigilantweather.com/forecast/forecast/submit.php The form will not sucessfully send to the MySQL database. Meanwhile, http://www.vigilantweather.com/forecast/floodwatch/submit.php will. Any ideas to fix this? Thanks :)
  20. Hi there, I am very excited about releasing a new addition to my website, and one of the crucial components is not functioning properly. I have a PHP form, called submit.php -- it will work with db.php -- in the same folder, to get access to the database. Here is an example of one of my already-working forms that sends this form data to my MySQL database to make it retrievable in a view file: submit.php [code]<? include("db.php"); $field1 = $_POST['field1']; $field2 = $_POST['field2']; $field3 = $_POST['field3']; $field4 = $_POST['field4']; $field5 = $_POST['field5']; if($_POST['sub'] == "yes") { if($field1 == "") { $error .= "You did not put identify the alert type.<BR>"; } //checks to see if the user filled in field1, or if they put in too much information, and defines the variable error if they did if(strlen($field1) > 200) { $error .= "Alert type is too long.<BR>"; } if($field2 == "") { $error .= "You did not add type any alert text.<BR>"; } //checks to see if the user filled in field1, or if they put in too much information, and defines the variable error if they did if(strlen($field2) > 999) { $error .= "Alert text is too long.<BR>"; } if($field3 == "") { $error .= "You did not identify yourself.<BR>"; } //checks to see if the user filled in field1, or if they put in too much information, and defines the variable error if they did if(strlen($field3) > 256) { $error .= "Forecaster name is too long.<BR>."; } if($field4 == "") { $error .= "You did not identify the counties effected.<BR>"; } //checks to see if the user filled in field1, or if they put in too much information, and defines the variable error if they did if(strlen($field4) > 700) { $error .= "Counties effected list is too long.<BR>"; } if($field5 == "") { $error .= "You did not identify the expiration of the alert.<BR>"; } //checks to see if the user filled in field1, or if they put in too much information, and defines the variable error if they did if(strlen($field5) > 500) { $error .= "The expiration for the alert is too long.<BR>"; } } if($_GET['success'] != "yes") { ?> <form action="submit.php" method=POST> <font size="2" face="Arial">Alert Type: </font><font face="Arial"> <input type="text" maxlength="200" name="field1" <? if(isset($field1)) { echo "value=\"" . $field1 . "\""; } ?>><font size="2"> Choices: Flood Watch -or- Flood Watch Update -or- Flood Watch Correction (Use choice 1 if it is just a normal Flood Watch issuance; use choice 2 if it is an update from an earlier Flood Watch; </font></font><font size="2" face="Arial"> use choice 3 if you are correcting a Flood Watch that you issued earlier)</font><p> <font face="Arial" size="2">Counties:&nbsp;&nbsp;&nbsp; </font><font face="Arial"> <input type="text" maxlength="700" name="field4" <? if(isset($field1)) { echo "value=\"" . $field4 . "\""; } ?>> <font size="2">List the counties here and separate by state and comma.&nbsp; Example: In Massachusetts: Bristol, Plymouth, and Barnstable counties.&nbsp; In Rhode Island: Providence county.</font></font></p> <p> <font face="Arial" size="2">Expires:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" maxlength="500" name="field5" <? if(isset($field1)) { echo "value=\"" . $field5 . "\""; } ?>> Format: <b>Until 8:00pm EDT, Monday, July 23, 2005. </b>Please make this correspond with a relevant expiration time and date and list it like so and please include the correct time zone.</font></p> <p> <font face="Arial" size="2">Alert Text:&nbsp; </font><font face="Arial"> <font size="2"> &nbsp;<textarea name="field2" rows="9" cols="78">Type in the alert, detailed, here.  Text box can fit up to 999 characters.</textarea></font><font size="2" face="Arial"><BR> Forecaster: </font>&nbsp;<input type="text" maxlength="256" name="field3" <? if(isset($field3)) { echo "value=\"" . $field3 . "\""; } ?>><font size="2"> (Your first and last name)</font><font size="2" face="Arial"><BR> </font><font face="Arial"> <input type="hidden" name="sub" value="yes"> <input type="submit" value="Send"></font></p> <p>**KEEP IN MIND: Flood Watches are not official alerts issued by NOAA!&nbsp; Also, we only issue Flood Watches if <font color="#000000">high flow or overflow of water from a river is possible in the given time period. It can also apply to heavy runoff or drainage of water into low-lying areas. These watches are generally issued for flooding that is expected to occur at least 6 hours after heavy rains have ended.</font> Be conservative, as with all other alerts issued via VWFN.<font size="2" face="Arial"> </font> </p> <p> <span style="font-style: italic; text-decoration: underline; background-color: #FF0000"> <a href="http://www.vigilantweather.com/forecast/alerts.html"> <font color="#FFFFFF">VERY IMPORTANT -- BOOKMARK:</font></a></span></p> <p><font color="#000080"> <span style="font-weight: 700; background-color: #00FFFF"> <a href="http://www.vigilantweather.com/forecast/alerts.html">REFERENCE: Go to the VWFN Weather Alerts page to view the official VWFN weather alert definitions.&nbsp; This will greatly help forecasters!&nbsp; Do not skip, this is an important step and will improve upon your forecasting for VWFN.&nbsp; Technical definitions; take notes, bookmark!</a></span></font></p> </form> <? } /* note: .= defines a variable or adds onto it if it already exists... for example $var1 = "hello"; $var1 .= " my name is corbin"; echo $var1; would out put hello my name is corbin */ if(isset($error)) { echo "There was one or more error!<BR>"; echo $error; } else { if(($_GET['success'] != "yes") && ($_POST['sub'] == "yes")) { // checks to see if $error is set of if the GET variable of success does not equal yes $field1 = htmlspecialchars($field1);// if $field does not return an error it replaces any thing that could be interpetted as a browser as html $field2 = htmlspecialchars($field2); $field3 = htmlspecialchars($field3); $field4 = htmlspecialchars($field4); $field5 = htmlspecialchars($field5); $q = mysql_query("INSERT INTO `" . $table_name . "` (`field1` , `field2` , `field3`, `field4`, `field5`) VALUES ('" . $field1 . "', '" . $field2 . "', '" . $field3 ."', '" . $field4 . "', '" . $field5 . "')"); if($q) { //what to do if the mysql query is successful $error = NULL; ?> <meta http-equiv="refresh" content="0;url=<? echo $_SERVER['HTTP_SELF'] . "?success=yes"; ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>"> <? //by forwarding to its self the page will clear its post values so if a user hits refresh its not inserted into the database again... }  //the meta tag has it forward it to this page cept with the $_GET['success'] tag set } elseif($_GET['success'] == "yes") { //what to do if $_GET['success'] does equal yes echo "Flood Watch successfully issued.<BR> View it <a href=\"http://www.vigilantweather.com/forecast/viewfloodwatch/bos_view.php\">Here</a>."; } } mysql_close(); //closes the link to mysql} ?>[/code] Please note how it is submitted. Now, I have a more fields and different types of fields--such as radio buttons and drop-downs, etc. Here is what I have so far, please compare to submit.php above... this one is also submit.php, but I will call it submit2.php in this post to minimize confusion: [code]<? include("db.php"); $precip1 = $_POST['precip1']; $heaviness1 = $_POST['heaviness1']; $conditions_1 = $_POST['conditions_1']; $conditions2_1 = $_POST['conditions2_1']; $winddir1 = $_POST['winddir1']; $high1 = $_POST['high1']; $low1 = $_POST['low1']; $pop1 = $_POST['pop1']; $wind1 = $_POST['wind1']; if($_POST['sub'] == "yes") { if($precip1 == "") { $error .= "You did not put identify the alert type.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($precip1) > 999) { $error .= "Alert type is too long.<BR>"; } if($heaviness1 == "") { $error .= "You did not add type any alert text.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($heaviness1) > 999) { $error .= "Alert text is too long.<BR>"; } if($conditions_1 == "") { $error .= "You did not identify yourself.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($conditions_1) > 999) { $error .= "Forecaster name is too long.<BR>."; } if($conditions2_1 == "") { $error .= "You did not identify the counties effected.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($conditions2_1) > 999) { $error .= "Counties effected list is too long.<BR>"; } if($winddir1 == "") { $error .= "You did not identify the expiration of the alert.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($winddir1) > 999) { $error .= "The expiration for the alert is too long.<BR>"; } if($high1 == "") { $error .= "You did not identify the expiration of the alert.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($high1) > 999) { $error .= "The expiration for the alert is too long.<BR>"; } if($low1 == "") { $error .= "You did not identify the expiration of the alert.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($low1) > 999) { $error .= "The expiration for the alert is too long.<BR>"; } if($pop1 == "") { $error .= "You did not identify the expiration of the alert.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($pop1) > 999) { $error .= "The expiration for the alert is too long.<BR>"; } if($wind1 == "") { $error .= "You did not identify the expiration of the alert.<BR>"; } //checks to see if the user filled in precip1, or if they put in too much information, and defines the variable error if they did if(strlen($wind1) > 999) { $error .= "The expiration for the alert is too long.<BR>"; } } if($_GET['success'] != "yes") { ?> <form action="submit.php" method=POST> <font face="Arial" size="2">Precipitation: </font><font face="Arial"> <select name="precip1">   <option value="No Precipitation">None</option>   <option>Rain</option>   <option>Snow</option>   <option>Wintry Mix</option>   <option>Freezing Rain</option>   <option>Sleet</option>   </select></font><p> <font face="Arial" size="2">Precipitation Heaviness:&nbsp;&nbsp;&nbsp; </font> <font face="Arial"> <input type="radio" value="Very Heavy" name="heaviness1" checked><font size="2">Very   Heavy </font> <input type="radio" value="Heavy" name="heaviness1"><font size="2"> Heavy   </font>   <input type="radio" value="Moderate" name="heaviness1"><font size="2"> Moderate   </font>   <input type="radio" value="Light" name="heaviness1"><font size="2"> Light   </font>   <input type="radio" value="Very Light" name="heaviness1"><font size="2"> Very Light&nbsp;   </font>   <input type="radio" value=" " name="heaviness1"><font size="2"> No Precipitation</font></font></p> <p> <font face="Arial" size="2">Conditions: </font><font face="Arial">       <select name="conditions_1">   <option value="Sunny Conditions">Sunny</option>   <option value="Increasing Cloudiness">Increasing Clouds</option>   <option value="Decreasing Cloudiness">Decreasing Clouds</option>   <option value="Mostly Sunny Conditions">Mostly Sunny</option>   <option value="Partly Cloudy Conditions">Partly Cloudy</option>   <option value="Mostly Cloudy Conditions">Mostly Cloudy</option>   <option value="Cloudy Conditions">Overcast</option>       </select></font><p> <font face="Arial" size="2">Additional Conditions:&nbsp;</font><font face="Arial"><select name="conditions2_1">   <option value=" ">N/A</option>   <option value='and windy'>Windy</option>   <option value='and humid'>Humid</option>       <option value="and foggy">Foggy</option>       </select><font size="2" face="Arial"> </font><font size="2">(Select N/A if this does not apply)</font><font size="2" face="Arial"><BR> Wind Direction: </font><font size="2">&nbsp;</font><select size="1" name="winddir1">   <option>Light and Variable</option>   <option>North</option>   <option>Northeast</option>   <option>East</option>   <option>Southeast</option>   <option>South</option>   <option>Southwest</option>   <option>West</option>   <option>Northwest</option>   </select></font></p>   <p><font face="Arial"><font size="2">Wind Speed: </font> <input type="text" name="wind1" size="4"><font size="2"> mph</font></font></p>   <p><font face="Arial"><font size="2">High Temperature: </font> <input type="text" name="high1" size="3"></font></p>   <p><font face="Arial"><font size="2">Low Temperature: </font> <input type="text" name="low1" size="3"></font></p>   <p><font face="Arial"><font size="2">Probability of Precipitation: </font> <select size="1" name="pop1">   <option>0%</option>   <option>10%</option>   <option>20%</option>   <option>30%</option>   <option>40%</option>   <option>50%</option>   <option>60%</option>   <option>70%</option>   <option>80%</option>   <option>90%</option>   <option>100%</option>   </select></font></p>   <p> <font face="Arial"> <font size="2" face="Arial"><BR> </font> <input type="hidden" name="sub" value="yes"> <input type="submit" value="Send"></p> </form> <? } /* note: .= defines a variable or adds onto it if it already exists... for example $var1 = "hello"; $var1 .= " my name is corbin"; echo $var1; would out put hello my name is corbin */ if(isset($error)) { echo "There was one or more error!<BR>"; echo $error; } else { if(($_GET['success'] != "yes") && ($_POST['sub'] == "yes")) { // checks to see if $error is set of if the GET variable of success does not equal yes $precip1 = htmlspecialchars($precip1);// if $field does not return an error it replaces any thing that could be interpetted as a browser as html $heaviness1 = htmlspecialchars($heaviness1); $conditions_1 = htmlspecialchars($conditions_1); $conditions2_1 = htmlspecialchars($conditions2_1); $winddir1 = htmlspecialchars($winddir1); $wind1 = htmlspecialchars($wind1); $high1 = htmlspecialchars($high1); $low1 = htmlspecialchars($low1); $pop1 = htmlspecialchars($pop1); $q = mysql_query("INSERT INTO `" . $table_name . "` (`precip1` , `heaviness1` , `conditions_1`, `conditions2_1`, `winddir`, `wind1`, `high`, `low`, `pop`) VALUES ('" . $precip1 . "', '" . $heaviness1 . "', '" . $conditions_1 ."', '" . $conditions2_1 . "', '" . $winddir1 . "', '" . $high1 . "', '" . $low1 . "', '" . $wind1 . "', '" . $pop1 . "')"); if($q) { //what to do if the mysql query is successful $error = NULL; ?> <meta http-equiv="refresh" content="0;url=<? echo $_SERVER['HTTP_SELF'] . "?success=yes"; ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>" ?>"> <? //by forwarding to its self the page will clear its post values so if a user hits refresh its not inserted into the database again... }  //the meta tag has it forward it to this page cept with the $_GET['success'] tag set } elseif($_GET['success'] == "yes") { //what to do if $_GET['success'] does equal yes echo "Dense Fog Advisory successfully issued.<BR> View it <a href=\"http://www.vigilantweather.com/forecast/viewfog/bos_view.php\">Here</a>."; } } mysql_close(); //closes the link to mysql} ?>[/code] Any ideas?  I would really appreciate any help I can get to get this to work.  I am not a great coder, so I will not be able to see what is wrong with it, unfortunately.  I would very much like to get this addition up and running soon, many of my viewers are excited as well.  This is going to be my last or "almost last" part of the new addition! :) Thank you, in advance! ;D
  21. I know how to write the PHP form, I do not know exactly how to incorporate the MySQL.  I have working PHP forms writing new information to empty tables in MySQL, but nothing of this nature.  I understand, but that file was just to get an idea what I am talking about because it does what I need to do. I already have the database set-up and working, has been for months with real data on it, like I said.  The table containing user data, including points data is called phpbb_users and the "field"(name?) is called user_points Any ideas how I can make the form do the following according to selection or whatever the user is "buying": Subtract x amount of points from y (current amount of points) stored in the database, making sure the user has enough, everything is correct, etc.? Thanks in advance.
  22. Hi everyone, I am working on a system here to subtract or add points from users.  I have a working MySQL database running with phpBB (Integramod) and a points system is installed in the database.  Many of the members on the message board have some amount of points. I want to create a PHP file or a few PHP files (if needed) to have a form where the user can "purchase" items with points, such as website advertising, or whatever else. I would need it to subtract the necessary amount of points from user_points in the phpbb_users table. Does anyone have any suggestions?  This would be a great addition and I would like to show it to everyone as soon as possible.  I am not a good coder but this may be of some use to reference from: pointscp.php: [code]<?php /*************************************************************************** *                              pointscp.php *                            ------------------- *  begin                : Sunday, April 14, 2002 *  copyright            : (C) 2002 Bulletin Board Mods *  email                : ssjslim@yahoo.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/functions_points.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // // // Program Start // if (isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode'])) { $mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } else { $mode = ''; } $user_id = (isset($HTTP_GET_VARS[POST_USERS_URL])) ? intval($HTTP_GET_VARS[POST_USERS_URL]) : 0; $template->set_filenames(array( 'body' => 'points_system.tpl') ); //Start if ($mode == 'donate') { if ($userdata['user_id'] == ANONYMOUS) { $redirect = "pointscp.$phpEx&mode=donate"; $redirect .= (isset($user_id)) ? '&' . POST_USERS_URL . '=' . $user_id : ''; header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true)); } if (!$board_config['points_donate']) { message_die(GENERAL_MESSAGE, $lang['Points_user_donation_off']); } if (isset($HTTP_POST_VARS['submit'])) { if(!empty($HTTP_POST_VARS['username'])) { $user_id = get_userid_from_name($HTTP_POST_VARS['username']); if (empty($user_id)) { $error = true; $error_msg = $lang['No_such_user']; } if ($user_id == $userdata['user_id']) { $error = true; $error_msg .= ((!empty($error_msg)) ? '<br />' : '') . sprintf($lang['Points_cant_donate_self'], $board_config['points_name']); } } else { $error = true; $error_msg = $lang['Points_no_username']; } if (abs(intval($HTTP_POST_VARS['amount'])) == 0) { $error = true; $error_msg .= ((!empty($error_msg)) ? '<br />' : '') . sprintf($lang['Points_enter_some_donate'], $board_config['points_name']); } if (isset($error)) { $template->set_filenames(array( 'reg_header' => 'error_body.tpl') ); $template->assign_vars(array( 'ERROR_MESSAGE' => $error_msg) ); $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); } else { $amount = abs(intval($HTTP_POST_VARS['amount'])); $from_points = get_user_points($userdata['user_id']); if ($amount > $from_points) { message_die(GENERAL_MESSAGE, sprintf($lang['Points_cant_donate'], $board_config['points_name'])); } add_points($user_id, $amount); subtract_points($userdata['user_id'], $amount); //Send doation email if the user wants it $sql = "SELECT username, user_lang, user_email, user_notify_donation FROM " . USERS_TABLE . " WHERE user_id = $user_id"; if (!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not get username & user_notify_donation & user_lang & user_email", '', __LINE__, __FILE__, $sql); } $to_userdata = $db->sql_fetchrow($result); if ($to_userdata['user_notify_donation']) { include($phpbb_root_path . 'includes/emailer.'.$phpEx); $emailer = new emailer($board_config['smtp_delivery']); $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n"; $emailer->use_template('user_notify_donation', $to_userdata['user_lang']); $emailer->email_address($to_userdata['user_email']); $emailer->extra_headers($email_headers); $emailer->assign_vars(array( 'DONATOR' => $userdata['username'], 'USERNAME' => $to_userdata['username'], 'AMOUNT_DONATE' => $amount, 'TOTAL_POINTS' => get_user_points($user_id), 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']), 'L_POINTS' => $board_config['points_name']) ); $emailer->send(); $emailer->reset(); } $loc = (!empty($HTTP_POST_VARS['location'])) ? $HTTP_POST_VARS['location'] : append_sid("pointscp.$phpEx?mode=donate"); $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . $loc . '">') ); $msg = $lang['Points_thanks_donation'] . '<br /><br />' . sprintf($lang['Click_return_points_donate'], '<a href="' . append_sid("pointscp.$phpEx?mode=donate") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); message_die(GENERAL_MESSAGE, $msg); } } $s_username = (!empty($user_id)) ? get_username_from_id($user_id) : ''; $location = (empty($HTTP_POST_VARS['location'])) ? $HTTP_SERVER_VARS['HTTP_REFERER'] : $location; $s_hidden_fields = '<input type="hidden" name="location" value="' . $location . '">'; $template->assign_vars(array( 'L_FIND_USERNAME' => $lang['Find_username'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_POINTS_TITLE' => $lang['Points_donation'], 'L_DONATE_TO' => sprintf($lang['Points_donate_to'], $board_config['points_name']), 'L_AMOUNT' => $lang['Points_amount'], 'L_AMOUNT_GIVE' => sprintf($lang['Points_give'], $board_config['points_name']), 'USERNAME' => $s_username, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_POST_ACTION' => append_sid("pointscp.$phpEx?mode=donate", true), 'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser")) ); $template->assign_block_vars('switch_points_donate', array()); } else { if ($userdata['user_id'] == ANONYMOUS) { $redirect = "pointscp.$phpEx"; $redirect .= (isset($user_id)) ? '&user_id=' . $user_id : ''; header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true)); } if ($userdata['user_level'] != ADMIN && user_is_authed($userdata['user_id']) == false) { message_die(GENERAL_MESSAGE, $lang['Points_not_admin']); } if (isset($HTTP_POST_VARS['submit'])) { if (empty($HTTP_POST_VARS['username']) && empty($HTTP_POST_VARS['mass_username'])) { $error = true; $error_msg .= $lang['Points_no_username']; } else { $user_id = get_userid_from_name($HTTP_POST_VARS['username']); if (empty($user_id) && empty($HTTP_POST_VARS['mass_username'])) { $error = true; $error_msg = $lang['No_such_user']; } else { $user_id_list = array(); $user_id_list[] = $user_id; if (!empty($HTTP_POST_VARS['mass_username'])) { $mass_usernames = explode("\n", $HTTP_POST_VARS['mass_username']); foreach ($mass_usernames as $username) { $username = trim($username); if (!empty($username)) { $user_id_list[] = get_userid_from_name($username); } } } $user_id_list = array_unique($user_id_list); } } if (isset($error)) { $template->set_filenames(array( 'reg_header' => 'error_body.tpl') ); $template->assign_vars(array( 'ERROR_MESSAGE' => $error_msg) ); $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); } else { $amount = abs(intval($HTTP_POST_VARS['amount'])); $method_function = ($HTTP_POST_VARS['method']) ? 'add_points' : 'subtract_points'; foreach ($user_id_list as $user_id) { if (!empty($user_id)) { $method_function($user_id, $amount); } } $loc = (isset($HTTP_POST_VARS['location']) && !empty($HTTP_POST_VARS['location'])) ? $HTTP_POST_VARS['location'] : append_sid("pointscp.$phpEx?mode=donate"); $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . $loc . '">') ); $msg = sprintf($lang['Points_user_updated'], $board_config['points_name']) . '<br /><br />' . sprintf($lang['Click_return_pointscp'], '<a href="' . append_sid("pointscp.$phpEx") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); message_die(GENERAL_MESSAGE, $msg); } } $s_username = (!empty($user_id)) ? get_username_from_id($user_id) : ''; $location = (!isset($HTTP_POST_VARS['location'])) ? $HTTP_SERVER_VARS['HTTP_REFERER'] : $location; $s_hidden_fields = '<input type="hidden" name="location" value="' . $location . '">'; $template->assign_vars(array( 'L_FIND_USERNAME' => $lang['Find_username'], 'L_ADD' => $lang['Add'], 'L_SUBTRACT' => $lang['Subtract'], 'L_SUBMIT' => $lang['Submit'], 'L_RESET' => $lang['Reset'], 'L_POINTS_TITLE' => $lang['Points_cp'], 'L_AMOUNT' => $lang['Points_amount'], 'L_AMOUNT_GIVE_TAKE' => sprintf($lang['Points_give_take'], $board_config['points_name']), 'L_METHOD' => $lang['Points_method'], 'L_ADD_SUBTRACT' => sprintf($lang['Points_add_subtract'], $board_config['points_name']), 'L_MASS_EDIT' => $lang['Points_mass_edit'], 'L_MASS_EDIT_EXPLAIN' => $lang['Points_mass_edit_explain'], 'USERNAME' => $s_username, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_POST_ACTION' => append_sid("pointscp.$phpEx", true), 'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser")) ); $template->assign_block_vars('switch_points_cp', array()); } // // Start output of page // $page_title = $lang['Points_sys']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); // // Generate the page // $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.