Mr Initial Man
07-29-2006, 08:21 PM
Not really a question so much as wanting your opinion on something. I've discovered that the switch function can do very nicely when creating a really simple database. What do you guys think? Below is something that I've done for my main website.
<?php
switch ($story)
{
case "beefbottle":
$title = "Beef in a Bottle";
$rating = "14";
$keywords = "steroids, muscle, family";
break;
case "comforter":
$title = "The Comforter";
$rating = "MA";
$keywords = "suicide";
break;
case "darknight":
$title = "Darkest Night";
$rating = "14";
$keywords = "murder, halloween";
$style = "blockquote{background:#fff;color:#008;margin:20px 60px 20px 60px;}";
break;
case "erintopping":
$title = "Meeting Erin Topping";
$rating = "PG";
$keywords = "fan, fiction, fanfic, Erin, Topping, WTF";
$for = "Erin Topping";
break;
case "josef":
$title = "Josef";
$rating = "PG";
$keywords = "muscle, disability";
$for = "Braford";
$forlink = "download.lavadomefive.com/members/braford/";
$fortitle = "Braford's Gym";
break;
case "mimjd":
$title = "Jack Daniels meets John-David";
$rating = "PG";
$keywords = "fursonas, comedy";
$style = "p.name{font-weight:bolder;}";
break;
case "oldstrong":
$title = "The Old That Is Strong";
$rating = "PG";
$keywords = "age, muscle, family";
break;
case "rainyday":
$title = "Rainy Evening Exercise <em style=\"font-size:90%; display:block\">or</em>Doktor Catlove Can Kiss My Wazoo";
$rating = "PG";
$keywords = "fan, fiction, Albert, Temple, Gene Catlow";
$titlebar = "Rainy Evening Exercise";
$for = "Albert Temple";
$forlink = "www.genecatlow.com";
$fortitle = "Gene Catlow";
break;
case "seduction":
$title = "Seduction";
$rating = "NC-17";
$keywords = "adult, yiff, comedy, sex, seduction, porn";
$style = "p.story{font-style:italic;margin:30px 0 30px 0;}";
break;
case "traditions":
$title = "Traditions";
$rating = "PG";
$keywords = "fighting, wrestling, fan, fiction, fanfic";
$style = "p.big{text-indent:0;font-size:110%;text-align:center;font-weight:bold;margin:10px 0 10px 0;}";
$for = "Lysozyme";
$forlink = "download.lavadomefive.com/members/Lysozyme/";
$fortitle = "Lysozyme's Pad";
break;
case "trevordate":
$title = "A Date with Trevor";
$rating = "14";
$keywords = "fan, fanfic, fan fiction, crossdressing, dating";
$for = "Shane Nelson";
$forlink = "www.shaylathepinkmouse.com";
$fortitle = "Shayla The Pink Mouse";
case "wolf":
$title = "Wolf Hunt";
$rating = "14";
$keywords = "Werewolf, hunting, wolf, vore, death, hunt";
default:
$story = "whoops";
$title = "Whoops!";
$rating = "NR";
}
?>
Pretty nice setup, IMHO, but you're all free to thunder at me for being a blasphemer.
<?php
switch ($story)
{
case "beefbottle":
$title = "Beef in a Bottle";
$rating = "14";
$keywords = "steroids, muscle, family";
break;
case "comforter":
$title = "The Comforter";
$rating = "MA";
$keywords = "suicide";
break;
case "darknight":
$title = "Darkest Night";
$rating = "14";
$keywords = "murder, halloween";
$style = "blockquote{background:#fff;color:#008;margin:20px 60px 20px 60px;}";
break;
case "erintopping":
$title = "Meeting Erin Topping";
$rating = "PG";
$keywords = "fan, fiction, fanfic, Erin, Topping, WTF";
$for = "Erin Topping";
break;
case "josef":
$title = "Josef";
$rating = "PG";
$keywords = "muscle, disability";
$for = "Braford";
$forlink = "download.lavadomefive.com/members/braford/";
$fortitle = "Braford's Gym";
break;
case "mimjd":
$title = "Jack Daniels meets John-David";
$rating = "PG";
$keywords = "fursonas, comedy";
$style = "p.name{font-weight:bolder;}";
break;
case "oldstrong":
$title = "The Old That Is Strong";
$rating = "PG";
$keywords = "age, muscle, family";
break;
case "rainyday":
$title = "Rainy Evening Exercise <em style=\"font-size:90%; display:block\">or</em>Doktor Catlove Can Kiss My Wazoo";
$rating = "PG";
$keywords = "fan, fiction, Albert, Temple, Gene Catlow";
$titlebar = "Rainy Evening Exercise";
$for = "Albert Temple";
$forlink = "www.genecatlow.com";
$fortitle = "Gene Catlow";
break;
case "seduction":
$title = "Seduction";
$rating = "NC-17";
$keywords = "adult, yiff, comedy, sex, seduction, porn";
$style = "p.story{font-style:italic;margin:30px 0 30px 0;}";
break;
case "traditions":
$title = "Traditions";
$rating = "PG";
$keywords = "fighting, wrestling, fan, fiction, fanfic";
$style = "p.big{text-indent:0;font-size:110%;text-align:center;font-weight:bold;margin:10px 0 10px 0;}";
$for = "Lysozyme";
$forlink = "download.lavadomefive.com/members/Lysozyme/";
$fortitle = "Lysozyme's Pad";
break;
case "trevordate":
$title = "A Date with Trevor";
$rating = "14";
$keywords = "fan, fanfic, fan fiction, crossdressing, dating";
$for = "Shane Nelson";
$forlink = "www.shaylathepinkmouse.com";
$fortitle = "Shayla The Pink Mouse";
case "wolf":
$title = "Wolf Hunt";
$rating = "14";
$keywords = "Werewolf, hunting, wolf, vore, death, hunt";
default:
$story = "whoops";
$title = "Whoops!";
$rating = "NR";
}
?>
Pretty nice setup, IMHO, but you're all free to thunder at me for being a blasphemer.