PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : فراخوانی توابع در whmcs



atryad
November 16th, 2013, 12:50
با سلام
من یک صفحه جدید در سیستم whmcs ایجاد کردم با استفاده از مستندات خود whmcs اما این صفحه عملیات مربوط به توابع رو نشون نمیده مثلا من میخوام قیمت دامنه ها توی ان صفحه جداگانه نمایش داده بشه هنگام نمایش هیچ محتویاتی نمایش نمیدهد چطور میتونم توابع رو فراخونی کنم

محتویات فایل php اصلی

<?php define("CLIENTAREA",true); //define("FORCESSL",true); // Uncomment to force the page to use https:// require("init.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle("قیمت دامنه ها"); $ca->addToBreadCrumb('index.php',$whmcs->get_lang('globalsystemname')); $ca->addToBreadCrumb('domainprice.php','قیمت دامنه ها'); $ca->initPage(); //$ca->requireLogin(); // Uncomment this line to require a login to access this page # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $ca->assign('variablename', $value); # Check login status if ($ca->isLoggedIn()) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=".$ca->getUserID()); $data = mysql_fetch_array($result); $clientname = $data[0]; $ca->assign('clientname', $clientname); } else { # User is not logged in } # Define the template filename to be used without the .tpl extension $ca->setTemplate('domainprice'); $ca->output(); ?>

و یک فایل tpl با نام domainprice در قالب ایجاد شده که محتویات این فایل شامل



<br />{if $lookup}
{if $available}<p align="center" class="textgreen" style="font-size:18px;">{$LANG.domainavailable1} <strong>{$domain}{$ext}</strong> {$LANG.domainavailable2}</p>{elseif $invalid}<p align="center" class="textred" style="font-size:18px;">{$LANG.ordererrordomaininvalid}</p>{elseif $error}<p align="center" class="textred" style="font-size:18px;">{$LANG.domainerror}</p>{else}<p align="center" class="textred" style="font-size:18px;">{$LANG.domainunavailable1} <strong>{$domain}{$ext}</strong> {$LANG.domainunavailable2}</p>{/if}
{if !$invalid}<h2>{$LANG.morechoices}</h2><form method="post" action="{$systemsslurl}cart.php?a=add&domain=register"> <table width="100%" border="0" cellpadding="10" cellspacing="0" class="data domain"> <tr class="title_gr"> <td width="20"></td> <td>{$LANG.domainname}</td> <td>{$LANG.domainstatus}</td> <td>{$LANG.domainmoreinfo}</td> </tr> {foreach key=num item=result from=$availabilityresults} <tr> <td>{if $result.status eq "available"} <input type="checkbox" name="domains[]" value="{$result.domain}" {if $num eq "0" && $available}checked {/if}/> <input type="hidden" name="domainsregperiod[{$result.domain}]" value="{$result.period}" /> {else}X{/if}</td> <td>{$result.domain}</td> <td class="{if $result.status eq "available"}textgreen{else}textred{/if}">{if $result.status eq "available"}{$LANG.domainavailable}{else}{$LANG.domainunavail able}{/if}</td> <td>{if $result.status eq "unavailable"}<a href="http://{$result.domain}" target="_blank">WWW</a> <a href="#" onclick="window.open('whois.php?domain={$result.domain}','w hois','width=500,height=400,scrollbars=yes');retur n false">WHOIS</a>{else} <select name="domainsregperiod[{$result.domain}]"> {foreach key=period item=regoption from=$result.regoptions} <option value="{$period}">{$period} {$LANG.orderyears} @ {$regoption.register}</option> {/foreach} </select> {/if}</td> </tr> {/foreach} </table> <p align="center"> <input type="submit" value="{$LANG.ordernowbutton}" class="submit" /> </p></form>{/if}
{else}<table width="100%" border="0" cellpadding="10" cellspacing="0" class="domain"> <tr class="title_gr"> <td>{$LANG.domaintld}</td> <td>{$LANG.domainminyears}</td> <td>{$LANG.domainsregister}</td> <td>{$LANG.domainstransfer}</td> <td>{$LANG.domainsrenew}</td> </tr> {foreach key=num item=tldpricelist from=$tldpricelist} <tr> <td style="direction:ltr">{$tldpricelist.tld}</td> <td>{$tldpricelist.period}</td> <td>{if $tldpricelist.register}{$tldpricelist.register}{el se}{$LANG.domainregnotavailable}{/if}</td> <td>{if $tldpricelist.transfer}{$tldpricelist.transfer}{el se}{$LANG.domainregnotavailable}{/if}</td> <td>{if $tldpricelist.renew}{$tldpricelist.renew}{else}{$L ANG.domainregnotavailable}{/if}</td> </tr> {/foreach}</table>{/if}<br />

vahab00
November 16th, 2013, 13:13
این کد رو چک کنید


<?php

define("CLIENTAREA",true);

require("dbconnect.php");
require("includes/functions.php");
require("includes/clientareafunctions.php");

$pagetitle = 'Shared Hosting';
$pageicon = "images/support/clientarea.gif";
$breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>';
$breadcrumbnav .= ' > <a href="sharedhosting.php">Shared Hosting</a>';

initialiseClientArea($pagetitle,$pageicon,$breadcr umbnav);

if ($_SESSION['uid']) {
# User is Logged In - put any code you like here
}

# To assign variables in Smarty use the following syntax.
# This can then be used as {$variablename} in the template

$smartyvalues["variablename"] = $value;

# Define the template filename to be used without the .tpl extension

$templatefile = "dedicatedhosting";

outputClientArea($templatefile);

?>

اینطور درستر هست . فایل tpl شما درست هست اما php باید مثل این باشه
یا حق

atryad
November 16th, 2013, 13:29
متاسفانه کار نمیکنه صفحه مثل قبل لود میشه ولی مثلا قیمت دامنه ها رو نشون نمیده
قیمت دامنه ها توی فایل domainchecker.tpl نمایش داده میشه اما من محتویات همینو توی فایل domainprice.tpl که ساختم و میخوام نمایش بده فقط هدر جدول و نوشته های معمولی میاد و چیزی از پردازش محتویات سیستم نمایش نمیده

atryad
November 18th, 2013, 02:12
اساتید عزیز و گرامی لطفا راهنمایی بفرمایید

EXXXIR
November 18th, 2013, 15:23
با ایجاد صفحه php سمپلی که هست شما فقط به فانکشن های کلی و اتصال به دیتابیس سیستم دسترسی دارید نه به برنامه نویسی های انجام شده برای هر صفحه.

برای مثال برای صفحه
domainchecker در فایل domainchecker.php برنامه نویسی های مرتبط با این صفحه انجام شده به همین دلیل متغیرهای اسمارتی فایل domainchecker.tpl به درستی کار میکنن. برای داشتن صفحه کامل با جزئیات یا باید خودتون موارد مورد نیاز برنامه نویسی کنید یا سورس domainchecker.php دربیارید و در صفحه جدید استفاده کنید.

atryad
November 19th, 2013, 23:04
چطور میتونم سورس کد شده رو پیدا کنم