include_once "../common/menu/menu.php"; // this will include a.php
MainPoetryMenu("Forms");
?>
A place to research new forms to use or learn about
$conn = mysql_connect($host,$user,$pass);
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
//Connection has succeeded!
if(mysql_select_db('bj_poetryforms',$conn))
{
if(is_numeric($searchstring))
{
//Search for forms with n number of lines
echo '
';
echo '
Search Results For ';
echo strtoupper($searchstring);
echo ' Line Forms
';
//retrieve info
$SQL = "SELECT formname, briefdescription FROM forms ";
$SQL = $SQL . "WHERE numberoflines LIKE '";
$SQL = $SQL . $searchstring . "' ";
$SQL = $SQL ."ORDER BY formname";
$retid = mysql_query("SET NAMES utf8"); //makes sure result renders correctly
$retid = mysql_db_query('bj_poetryforms',$SQL, $conn);
if (!$retid)
{
die( mysql_error());
}
else
{
/* fetch rows */
$NumberOfRows = mysql_num_rows($retid);
for ($i = 0; $i < $NumberOfRows; $i++)
{
if (!mysql_data_seek($retid, $i))
{
echo "Cannot seek to row $i: " . mysql_error() . "\n";
continue;
}
if (!($row = mysql_fetch_assoc($retid)))
{
continue;
}
echo '
';
echo parse_bbcode('[l]'.$row['formname'].'[/l]');
echo '
';
echo parse_bbcode($row['briefdescription']);
echo '
More...
';
}
}
echo'
Search by Number of Lines
';
echo'
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26';
echo '
';
}
else if(strlen($searchstring) == 1)
{
//Search for forms beginning with
echo '';
echo '
Search Results For Forms Beginning With - ';
echo strtoupper($searchstring);
echo '
';
//retrieve info
$SQL = "SELECT formname, briefdescription FROM forms ";
$SQL = $SQL . "WHERE formname LIKE '";
$SQL = $SQL . $searchstring . "%' ";
$SQL = $SQL . "ORDER BY formname";
$retid = mysql_query("SET NAMES utf8"); //makes sure result renders correctly
$retid = mysql_db_query('bj_poetryforms',$SQL, $conn);
if (!$retid)
{
die( mysql_error());
}
else
{
/* fetch rows */
$NumberOfRows = mysql_num_rows($retid);
for ($i = 0; $i < $NumberOfRows; $i++)
{
if (!mysql_data_seek($retid, $i))
{
echo "Cannot seek to row $i: " . mysql_error() . "\n";
continue;
}
if (!($row = mysql_fetch_assoc($retid)))
{
continue;
}
echo '
';
echo parse_bbcode('[l]'.$row['formname'].'[/l]');
echo '
';
echo parse_bbcode($row['briefdescription']);
echo '
More...
';
}
}
echo'
Search by Alphabetical Order
';
echo'
a-
b-
c-
d-
e-
f-
g-
h-
i-
j-
k-
l-
m-
n-
o-
p-
q-
r-
s-
t-
u-
v-
w-
x-
y-
z';
echo '
';
}
else
{
//Connection is totally successful
//retrieve info
$SQL = " SELECT * FROM forms ";
$SQL = $SQL . " WHERE formname = '$searchstring' ";
$retid = mysql_query("SET NAMES utf8"); //makes sure result renders correctly
$retid = mysql_db_query('bj_poetryforms',$SQL, $conn);
if (!$retid) { die( mysql_error()); }
//If we are here we have succeeded in finding our info
if($result = mysql_fetch_assoc($retid))
{
echo '';
echo '
Search result for ';
echo ucfirst($searchstring);
echo '
';
echo '
';
echo '
Brief Description
';
#brief info here, phase for links
echo parse_bbcode($result["briefdescription"]);
echo '
';
echo '
';
echo '
Form Type: | ';
#database info here about form type
echo $result["formtype"];
echo ' |
Origins: | ';
#database info here about origins
echo $result["origins"];
echo ' | Creator: | ';
#database info here about creator
echo $result["creator"];
echo ' | Number of Lines: | ';
#database info about number of lines
echo parse_bbcode('[l]'.$result["numberoflines"].'[/l]');
echo ' | Rhyme Scheme: | ';
#info here about rhyme scheme
echo $result["rhymescheme"];
echo ' | Meter: | ';
#Info about meter here
echo $result["meter"];
echo ' |
';
echo '
Rules
';
#database rules info
echo parse_bbcode($result["rules"]);
echo '
Examples
';
#database info here about examples
echo parse_bbcode($result["examples"]);
echo '
Notes
';
#database info here about notes, phase for links
echo parse_bbcode($result["notes"]);
echo '
Links
';
#database info here about links
echo parse_bbcode($result["links"]);
echo '
Print This Information
';
echo '
Bookmark this page
';
echo '
';
echo '
';
}
else
{
echo 'Sorry your search did not yield any results, please press the back button on your Browser and try a different search term.';
}
}
}
mysql_close($conn);
?>