should it be

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
Bewbs

should it be

Post by Bewbs »

should it be:

Code: Select all

function executeuser()
{
code
function dome()
{
code
}
function notme()
{
code
}
}
or

Code: Select all

function executeuser()
{
code
}
function dome()
{
code
}
function notme()
{
code
}
or does it not matter?
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm
Location: Fairless Hills, Pa USA

should it be

Post by Ted »

It very much does matter.

B.
Bewbs

should it be

Post by Bewbs »

does it have to be

Code: Select all

$query = "SELECT * FROM ".cms_db_prefix()."module_poll WHERE active='yes'";
$dbresult = $db->Execute($query);
or could it be

Code: Select all

$questionquery = "SELECT * FROM ".cms_db_prefix()."module_poll WHERE active='yes'";
$dbresult = $db->Execute($questionquery);
Bewbs

should it be

Post by Bewbs »

Code: Select all

function poll_module_install($cms) {
	//This function should install the database functions and do other basic init stuff for first time use.
	$db = $cms->db;
	$dict = NewDataDictionary($db);
	$flds = "
    pollid I9 DEF '0' NOTNULL AUTO, 
    question TINYTEXT NOTNULL,
	lastip TEXT,
    active C(3) DEF 'no' NOTNULL, KEY (poll_id) 
	";
	$taboptarray = array('mysql' => 'TYPE=MyISAM');
	$sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_poll", $flds, $taboptarray);
	$dict->ExecuteSQLArray($sqlarray);

	$db->CreateSequence(cms_db_prefix()."module_poll_seq");
	
	$flds = "
	answerid I9 DEF '0' NOTNULL AUTO, 
    pollid I9, 
	answers C(20) NOTNULL,
	votes I9 DEF '0',
	result I9 DEF '0', KEY (poll_answer_id)
	";
	$sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_poll_answers", $flds, $taboptarray);
	$dict->ExecuteSQLArray($sqlarray);
	
	$db->CreateSequence(cms_db_prefix()."module_poll_answers_seq");


	cms_mapi_create_permission($cms, 'Modify Poll', 'Modify Poll');
}
only creates module_poll_seq and module_poll_answers_seq

see any problems as to why it wont create the other two tables?
Post Reply

Return to “Developers Discussion”