****====Graph Maker==== Graph maker allows a user to place graphs on a wiki page using (and requiring on the server) GD2. There are three files. (1) ##graphentry.php## is an action that creates a form on a wiki page that allows a user to easily create a wiki action call to embed on a page so that a graph might be placed there. It provides a preview of the graph so that the user does not have to embed the code on a wiki page to see the output. (2) ##graph.php## is the action that reads the generated code and renders the graph on the page. Both previous actions should be placed in the ##actions## directory. (3) Both of these previous reactions rely on [[http://www.phpclasses.org/browse/package/1993.html | class.graphic.php]] which should be renamed "##graphmaker.php##" and placed in a directory called ##scripts## in the wiki root (no other alterations are necessary). http://gmbtst.msvu.ca/wikitest/graphmaker.jpg ##graphentry.php## %%(php) // graphmaker.php Version 1 -- Jan 9, 2005 // Original parts of this script were developed by G. Michael Bowen for a SSHRC research project using wikka wiki. // This action generates graph images & code that can be placed on a wikka page to place the image there. // REQUIRES graph.php to place the code on a page as an action AND // REQUIRES class.graphic.php (http://www.phpclasses.org/browse/package/1993.html) // to be renamed graphmaker.php & placed in a directory called "scripts" in the wikka root. // REQUIRES GD2 on the server // Parts of the code on this page derive from class.graphic.php // Non-derivative code copyright GMBowen. Released to public domain under GPL. Modify, improve, change as you wish. // NOTE that implementation may require the value "16" to be changed 6 lines down. // TODO - a save feature is forthcoming, "if" statements to reduce code output to only parameters with data $site_base = $this->GetConfigValue("base_url"); // The CODE LINE below is assuming that your statement LIKE wakka.php?wakka= in the config file is 16 characters long // IF IT IS NOT 16 CHARACTERS LONG, then count the characters & replace the 16 in the line below. $site_base = substr($site_base,0,-16); $site_base = $site_base."scripts/"; $url = $site_base."graphmaker.php"; $grftitle = $_POST["title"]; $xaxis = $_POST["axis_x"]; $yaxis = $_POST["axis_y"]; $vartitle1 = $_POST["graphic_1"]; $vartitle2 = $_POST["graphic_2"]; $grftype = $_POST["type"]; $grfskin = $_POST["skin"]; $grphc2val = $_POST["graphic_2_values"]; $grfx0 = $_POST["x0"]; $grfy0 = $_POST["y0"]; $grfz0 = $_POST["z0"]; $grfx = array($_POST[x0], $_POST[x1], $_POST[x2], $_POST[x3], $_POST[x4], $_POST[x5], $_POST[x6], $_POST[x7], $_POST[x8], $_POST[x9], $_POST[x10], $_POST[x11], $_POST[x12], $_POST[x13], $_POST[x14], $_POST[x15], $_POST[x16], $_POST[x17], $_POST[x18], $_POST[x19]); $grfy = array($_POST[y0], $_POST[y1], $_POST[y2], $_POST[y3], $_POST[y4], $_POST[y5], $_POST[y6], $_POST[y7], $_POST[y8], $_POST[y9], $_POST[y10], $_POST[y11], $_POST[y12], $_POST[y13], $_POST[y14], $_POST[y15], $_POST[y16], $_POST[y17], $_POST[y18], $_POST[y19]); $grfz = array($_POST[z0], $_POST[z1], $_POST[z2], $_POST[z3], $_POST[z4], $_POST[z5], $_POST[z6], $_POST[z7], $_POST[z8], $_POST[z9], $_POST[z10], $_POST[z11], $_POST[z12], $_POST[z13], $_POST[z14], $_POST[z15], $_POST[z16], $_POST[z17], $_POST[z18], $_POST[z19]); $numrowsx = $_POST["amountofdata"]; if (empty($numrowsx)) {$numrowsx=9;} $numcolsx = $_POST["numcols"]; if (empty($numcolsx)) {$numcolsx=1;} if ($numcolsx==1){$_POST[z0]=""; $_POST[z1]=""; $_POST[z2]=""; $_POST[z3]=""; $_POST[z4]=""; $_POST[z5]=""; $_POST[z6]=""; $_POST[z7]=""; $_POST[z8]=""; $_POST[z9]=""; $_POST[z10]=""; $_POST[z11]=""; $_POST[z12]=""; $_POST[z13]=""; $_POST[z14]=""; $_POST[z15]=""; $_POST[z16]=""; $_POST[z17]=""; $_POST[z18]=""; $_POST[z19]="";} $urlstrng="title=".$grftitle."&axis_x=".$xaxis."&axis_y=".$yaxis."&graphic_1=".$vartitle1."&graphic_2=".$vartitle2 ."&type=".$grftype."&skin=".$grfskin."&graphic_2_values=".$grphc2val."&x0=".$_POST[x0]."&x1=".$_POST[x1]."&x2=".$_POST[x2] ."&x3=".$_POST[x3]."&x4=".$_POST[x4]."&x5=".$_POST[x5]."&x6=".$_POST[x6]."&x7=".$_POST[x7]."&x8=".$_POST[x8]."&x9=".$_POST[x9] ."&x10=".$_POST[x10]."&x11=".$_POST[x11]."&x12=".$_POST[x12]."&x13=".$_POST[x13]."&x14=".$_POST[x14]."&x15=".$_POST[x15] ."&x16=".$_POST[x16]."&x17=".$_POST[x17]."&x18=".$_POST[x18]."&x19=".$_POST[x19]."&y0=".$_POST[y0]."&y1=".$_POST[y1] ."&y2=".$_POST[y2]."&y3=".$_POST[y3]."&y4=".$_POST[y4]."&y5=".$_POST[y5]."&y6=".$_POST[y6]."&y7=".$_POST[y7]."&y8=".$_POST[y8] ."&y9=".$_POST[y9]."&y10=".$_POST[y10]."&y11=".$_POST[y11]."&y12=".$_POST[y12]."&y13=".$_POST[y13]."&y14=".$_POST[y14] ."&y15=".$_POST[y15]."&y16=".$_POST[y16]."&y17=".$_POST[y17]."&y18=".$_POST[y18]."&y19=".$_POST[y19]."&z0=".$_POST[z0] ."&z1=".$_POST[z1]."&z2=".$_POST[z2]."&z3=".$_POST[z3]."&z4=".$_POST[z4]."&z5=".$_POST[z5]."&z6=".$_POST[z6]."&z7=".$_POST[z7] ."&z8=".$_POST[z8]."&z9=".$_POST[z9]."&z10=".$_POST[z10]."&z11=".$_POST[z11]."&z12=".$_POST[z12]."&z13=".$_POST[z13] ."&z14=".$_POST[z14]."&z15=".$_POST[z15]."&z16=".$_POST[z16]."&z17=".$_POST[z17]."&z18=".$_POST[z18]."&z19=".$_POST[z19]; ?>