ребят кто знает smarty подскажите как правильно переписать код? Код (PHP): $id = $invoiceid = (int)$whmcs->get_req_var("id"); $breadcrumbnav = "<a href=\"index.php\">" . $whmcs->get_lang("globalsystemname") . "</a> > <a href=\"clientarea.php\">" . $whmcs->get_lang("clientareatitle") . "</a> > <a href=\"clientarea.php?action=invoices\">" . $_LANG['invoices'] . "</a> > <a href=\"viewinvoice.php?id=" . $invoiceid . "\">" . $pagetitle . "</a>"; initialiseClientArea($whmcs->get_lang("invoicestitle") . $invoiceid, "", $breadcrumbnav); if (!isset($_SESSION['uid']) && !isset($_SESSION['adminid'])) { $goto = "viewinvoice"; require "login.php"; exit(); } $invoice = new WHMCS_Invoice(); $invoice->setID($invoiceid); $invoiceexists = $invoice->loadData(); $allowedaccess = (isset($_SESSION['adminid']) ? true : $invoice->isAllowed()); if (!$invoiceexists || !$allowedaccess) { $smarty->assign("error", "on"); $template_output = $smarty->fetch($whmcs->get_sys_tpl_name() . "/viewinvoice.tpl"); echo $template_output; exit(); } if ((($invoice->getData("status") == "Paid" && isset($_SESSION['orderdetails'])) && $_SESSION['orderdetails']['InvoiceID'] == $invoiceid) && !$_SESSION['orderdetails']['paymentcomplete']) { $_SESSION['orderdetails']['paymentcomplete'] = true; redir("a=complete", "cart.php"); } $gateway = $whmcs->get_req_var("gateway"); if ($gateway) { check_token(); $gateways = new WHMCS_Gateways(); $validgateways = $gateways->getAvailableGateways($invoiceid); if (array_key_exists($gateway, $validgateways)) { update_query("tblinvoices", array("paymentmethod" => $gateway), array("id" => $invoiceid)); run_hook("InvoiceChangeGateway", array("invoiceid" => $invoiceid, "paymentmethod" => $gateway)); } redir($invoiceid); } $creditbal = get_query_val("tblclients", "credit", array("id" => $invoice->getData("userid"))); if ($invoice->getData("status") == "Unpaid" && 0 < $creditbal) { $balance = $invoice->getData("balance"); $creditamount = $whmcs->get_req_var("creditamount"); if ($whmcs->get_req_var("applycredit") && 0 < $creditamount) { check_token(); if ($creditbal < $creditamount) { echo $_LANG['invoiceaddcreditovercredit']; exit(); } else { if ($balance < $creditamount) { echo $_LANG['invoiceaddcreditoverbalance']; exit(); } else { applyCredit($invoiceid, $invoice->getData("userid"), $creditamount); } } redir("id=" . $invoiceid); } $smartyvalues['manualapplycredit'] = true; $smartyvalues['totalcredit'] = formatCurrency($creditbal) . generate_token("form"); if (!$creditamount) { $creditamount = ($balance <= $creditbal ? $balance : $creditbal); } $smartyvalues['creditamount'] = $creditamount; } $outputvars = $invoice->getOutput(); $smartyvalues = array_merge($smartyvalues, $outputvars); $invoiceitems = $invoice->getLineItems(); $smartyvalues['invoiceitems'] = $invoiceitems; $transactions = $invoice->getTransactions(); $smartyvalues['transactions'] = $transactions; $paymentbutton = (($invoice->getData("status") == "Unpaid" && 0 < $invoice->getData("balance")) ? $invoice->getPaymentLink() : ""); $smartyvalues['paymentbutton'] = $paymentbutton; $smartyvalues['offlinepaid'] = $whmcs->get_req_var("offlinepaid"); if ($whmcs->get_config("AllowCustomerChangeInvoiceGateway")) { $smartyvalues['allowchangegateway'] = true; $gateways = new WHMCS_Gateways(); $availablegateways = $gateways->getAvailableGateways($invoiceid); $frm = new WHMCS_Form(); $gatewaydropdown = generate_token("form") . $frm->dropdown("gateway", $availablegateways, $invoice->getData("paymentmodule"), "submit()"); $smartyvalues['gatewaydropdown'] = $gatewaydropdown; } else { $smartyvalues['allowchangegateway'] = false; } outputClientArea("viewinvoice"); чтоб было наподобие этого Код (PHP): if ($action == "emails") { $ca->addToBreadCrumb("clientarea.php?action=emails", $whmcs->get_lang("clientareaemails")); } ________________ if ($action == "emails") { checkContactPermission("emails"); $ca->setTemplate("clientareaemails"); $result = select_query("tblemails", "COUNT(*)", array("userid" => $client->getID()), "id", "DESC"); $data = mysql_fetch_array($result); $numitems = $data[0]; list($orderby, $sort, $limit) = clientAreaTableInit("emails", "date", "DESC", $numitems); $smartyvalues['orderby'] = $orderby; $smartyvalues['sort'] = strtolower($sort); if ($orderby == "subject") { $orderby = "subject"; } else { $orderby = "date"; } $emails = array(); $result = select_query("tblemails", "", array("userid" => $client->getID()), $orderby, $sort, $limit); while ($data = mysql_fetch_array($result)) { $id = $data['id']; $date = $data['date']; $subject = $data['subject']; $date = fromMySQLDate($date, 1, 1); $emails[] = array("id" => $id, "date" => $date, "subject" => $subject); } $ca->assign("emails", $emails); $smartyvalues = array_merge($smartyvalues, clientAreaTablePageNav($numitems)); } а то что то нифига не получается((( вот например код Код (Text): if ($action == "emails") { вызывается по адресу http://site.ru/clientarea.php?action=emails хочется как то первый код переписать чтоб вызывалось так http://site.ru/clientarea.php?action=viewinvoice=?id=38 помогите его переписать ребят пожалуйста, а то нифига не получается сколько не пытался разобраться в этом smarty(((((((((((((((((((
за тебя писать все это никто не будет, думаю. ибо кода приведено много и переписывать все это под смарти, тем более когда не совсем понятно в чем проблема - лениво. начни делать сам. и если не получается - задавай конкретные небольшие вопросы. на них тебе тут точно ответят.