wiseprt Posted December 14, 2012 Share Posted December 14, 2012 Hello there, I just registered to the community cause i need help! My problem is that i have an ftp (home) server and i want to included this in server status page of WHMCS but i want only to show FTP PORT for this specific server. I think that something like this is possible with php if statements like "If this server, then only show ftp status." So i tried this one {if $server.name == 'server_name_here'} <tr> <td>{$server.name}</td> <td></td> <td>{get_port_status num="$num" port="21"}</td> <td></td> <td></td> <td></td> <td></td> </tr> {/if} but is not working... I am sure that i am doing something wrong. Maybe i am not good with php in .tpl files! Please help guys. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted December 14, 2012 Share Posted December 14, 2012 I didn't understand the whole thing but if you need php if statement do the following: // Start PHP if() {php} if($whatever=="bobby") { {/php} // Show something {if $server.name == 'server_name_here'} <tr> <td>{$server.name}</td> <td></td> <td>{get_port_status num="$num" port="21"}</td> <td></td> <td></td> <td></td> <td></td> </tr> {/if} // End PHP if() {php} } {/php} 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted December 17, 2012 Author Share Posted December 17, 2012 Hello Kian, thank you for your response. To be more specific i need here To show only FTP port for the Backup Server. I tried your code but something doing wrong... i'am very new to php coding, so you can understand! Any help will be appreciated. Thanks again. 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted December 20, 2012 Author Share Posted December 20, 2012 Hello again, Tried to give you a screenshot for better undertanding but the admin still not approved it! So i say you again that i want to edit the serverstatus.tpl in order to display ONLY FTP PORT but for a specific server only! Trying your code but is not working... 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted December 22, 2012 Author Share Posted December 22, 2012 As i can see the admin approve my screenshot, so now i think you can understand exactly what i need. I am waiting for help people! The issue need to be solved! Regards everyone... 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted January 19, 2013 Author Share Posted January 19, 2013 Any ideas? Still having the issue... 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted January 19, 2013 Share Posted January 19, 2013 Add {debug} in the tpl file and paste here the array that is involved in that server list. As i've already said in my previous post it's just a question of one single Smarty if() statement. 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted January 19, 2013 Share Posted January 19, 2013 try this, this should show only FTP status for all.. <table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" class="data"> <tr> <th>{$LANG.servername}</th> <!-- <th>HTTP</th> --> <th>FTP</th> <!-- <th>POP3</th> --> <th>{$LANG.serverstatusphpinfo}</th> <th>{$LANG.serverstatusserverload}</th> <th>{$LANG.serverstatusuptime}</th> </tr> {foreach key=num item=server from=$servers} <tr> <td>{$server.name}</td> <!-- <td id="port80_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> --> <td id="port21_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <!-- <td id="port110_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> --> <td><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a></td> <td id="load{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td id="uptime{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /> <script> /* checkPort({$num},80); */ checkPort({$num},21); /* checkPort({$num},110); */ getStats({$num}); </script> </td> </tr> {foreachelse} <tr> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </table> 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted January 22, 2013 Author Share Posted January 22, 2013 Hello Kian, You want this if i understanding well what you said. =4 => Array (9) name => FTP Backup Server ipaddress => 212.251.46.58 statusaddr => ftp://212.251.46.58/status/index.php phpinfourl => ftp://212.251.46.58/status/index.php?... serverload => empty uptime => empty phpver => empty mysqlver => empty zendver => empty Am i right? Thanks so much for helping... 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted January 22, 2013 Author Share Posted January 22, 2013 Hello durangod, I want this but only for the FTP Server in the list. As Kian said this must be a simple "if" statement. try this, this should show only FTP status for all.. <table width="100%" border="0" align="center" cellpadding="10" cellspacing="0" class="data"> <tr> <th>{$LANG.servername}</th> <!-- <th>HTTP</th> --> <th>FTP</th> <!-- <th>POP3</th> --> <th>{$LANG.serverstatusphpinfo}</th> <th>{$LANG.serverstatusserverload}</th> <th>{$LANG.serverstatusuptime}</th> </tr> {foreach key=num item=server from=$servers} <tr> <td>{$server.name}</td> <!-- <td id="port80_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> --> <td id="port21_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <!-- <td id="port110_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> --> <td><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a></td> <td id="load{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td id="uptime{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /> <script> /* checkPort({$num},80); */ checkPort({$num},21); /* checkPort({$num},110); */ getStats({$num}); </script> </td> </tr> {foreachelse} <tr> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} </table> 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted January 22, 2013 Share Posted January 22, 2013 Ok you can get this... With this: {foreach from=$servers key=num item=server} {if $server.ipaddress eq 'YOUR_BACKUP_SERVER_IP'} <tr> <td>{$server.name}</td> <td class="textcenter" id="port21_{$num}" colspan="3"><img src="images/loadingsml.gif" alt="{$LANG.loading}"/></td> <td class="textcenter"><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a></td> <td class="textcenter" id="load{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td class="textcenter" id="uptime{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /><script> checkPort({$num},80); checkPort({$num},21); checkPort({$num},110); getStats({$num}); </script></td> </tr> {else} <tr> <td>{$server.name}</td> <td class="textcenter" id="port80_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td class="textcenter" id="port21_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td class="textcenter" id="port110_{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td class="textcenter"><a href="{$server.phpinfourl}" target="_blank">{$LANG.serverstatusphpinfo}</a></td> <td class="textcenter" id="load{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /></td> <td class="textcenter" id="uptime{$num}"><img src="images/loadingsml.gif" alt="{$LANG.loading}" /><script> checkPort({$num},80); checkPort({$num},21); checkPort({$num},110); getStats({$num}); </script></td> </tr> {/if} {foreachelse} <tr> <td colspan="7">{$LANG.serverstatusnoservers}</td> </tr> {/foreach} You can exclude your backup server by IP in this statement {if $server.ipaddress eq 'YOUR_BACKUP_SERVER_IP'}. That's it. 0 Quote Link to comment Share on other sites More sharing options...
wiseprt Posted January 23, 2013 Author Share Posted January 23, 2013 Great! Finally is working! Thanks a lot Kian 0 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.