Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th November 2011, 15:18
caudatus caudatus is offline
Junior Member
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default *.list.php: how get records from an SQL query instead of a table

Dear Till!


It's the first time when I can say a big thank for this great admin sw, "ispconfig"!

Could You tell me,
that Is it possible in *.list.php files to get records from an SQL select query instead of a simple table ?

To define the record source by default the form (with an example table) is:

$liste["table"] = "mail_forwarding";

It would be nice to create merged lists, for example primary and secondary dns zones in one list.

Thank You very much!

Janos
Reply With Quote
Sponsored Links
  #2  
Old 28th November 2011, 15:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,202
Thanks: 829
Thanked 5,420 Times in 4,262 Posts
 
Default

Each list object in ISPConfig is based on the class listform_actions. The listform actions can be found in interface/lib/classes/listform_actions.inc.php file. This class contains a function named getQueryString() which returns the sql string that is used to display the list. To show lists with a more complex sql syntax, you can override the function getQueryString() in your custom list file.

Example:

Code:
$app->load('listform_actions');

class list_action extends listform_actions {
	
	function getQueryString(){
                $my_sql_query = "SELECT * FROM a,b WHERE ......";
                return $my_sql_query;

	}
	
}

$list = new list_action;
$list->onLoad();
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
list.php, sql, table

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
server.sh not starting up tuxillo Installation/Configuration 8 31st December 2010 14:14
Step by step email setup for domain & clients aurasdoom Installation/Configuration 17 19th January 2010 12:25
sarg issue while generating reports for squid mail4vij Server Operation 3 31st December 2009 13:12
phpmyadmin error lifeisboost Installation/Configuration 9 14th August 2008 19:19
Rejected e-mail (unknown user) w/Postfix doronkeller HOWTO-Related Questions 9 27th January 2008 20:09


All times are GMT +2. The time now is 10:46.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.