Ben Nash Posted February 10, 2012 Share Posted February 10, 2012 (edited) When you click the Chop button it should go to a page saying You choped the down the normal log but it doesnt display the message. Here are my files below: woodcutting.tpl {include file="header.tpl" TITLE="Wood Cutting"} <h1>The Woods</h1> <p> <h2>Log Types</h2> <table width="50%" border="1"> <tr> <th>Log Type</th> <th>Level Needed</th> <th>-</th> </tr> <tr> <td>Normal Log</td> <td>1</td> <td><form action='index.php?mod=WoodCutting&act=log1' method='POST'><input type='submit' name='choplog1' value='Chop' /></form></td> </tr> </table> </p> {include file="footer.tpl"} cuttinglog1.tpl {include file="header.tpl" TITLE="Cutting Log"} <h1>Cutting Normal Log</h1> {include file="footer.tpl"} modules/WoodCutting/index.php <?php //This file cannot be viewed, it must be included defined('IN_EZRPG') or exit; class Module_WoodCutting extends Base_Module { public function start() { //Require the user to be logged in requireLogin(); if (isset($_GET['act'])) { switch($_GET['act']) { case 'log1': $this->log1(); break; default: $this->home(); break; } } else { $this->home(); } } private function home() { $this->tpl->display('woodcutting.tpl'); } private function log1() { $this->tpl->display('cuttinglog1.tpl'); $msg = 'You chopped the normal log down.'; } } ?> Thank you. Edited February 10, 2012 by Ben Nash Quote Link to comment Share on other sites More sharing options...
Spudinski Posted February 10, 2012 Share Posted February 10, 2012 (edited) Module: private function log1() { $this->tpl->assign('msg', 'You chopped the normal log down.'); $this->tpl->display('cuttinglog1.tpl'); } Tpl: {include file="header.tpl" TITLE="Wood Cutting"} <h1>The Woods</h1> {if isset($msg) } <p>{$msg}</p> {/if} <h2>Log Types</h2> <table width="50%" border="1"> <tr> <th>Log Type</th> <th>Level Needed</th> <th>-</th> </tr> <tr> <td>Normal Log</td> <td>1</td> <td><form action='index.php?mod=WoodCutting&act=log1' method='POST'><input type='submit' name='choplog1' value='Chop' /></form></td> </tr> </table> {include file="footer.tpl"} Ref: http://www.smarty.net/docsv2/en/api.assign.tpl Edited February 10, 2012 by Spudinski Quote Link to comment Share on other sites More sharing options...
Ben Nash Posted February 10, 2012 Author Share Posted February 10, 2012 (edited) fixed ----------------- Edited February 10, 2012 by Ben Nash Quote Link to comment Share on other sites More sharing options...
JordanD Posted February 11, 2012 Share Posted February 11, 2012 I can't help but wonder if this an attempt at cloning my Woodcutting mod in my game... Quote Link to comment Share on other sites More sharing options...
Spudinski Posted February 11, 2012 Share Posted February 11, 2012 I can't help but wonder if this an attempt at cloning my Woodcutting mod in my game... Unless you have a patent for it, it doesn't really matter, does it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.