ok... i have a little problem on showing the indexes for "settinggroup". can anyone help me to do a function that let me check what is the highest Cardinality value in "settinggroupid" field?
what i want to do is this:
make the installer script check what is the highest cardinality value in settinggroup and warn the user that this value is taken if selected as default by the script.
example of query:
PHP Code:
$settinggroupid = "32";
$DB_site->query("INSERT INTO settinggroup VALUES ($settinggroupid,'Home Page Options',$settinggroupid)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'News forum ID','newsforumid','15','The specified forum will contain threads viewed on the main page only.','',0)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Order of news posts','newsorder','1','The standard (recommended) way to display news is chronologically from latest post to the newest one. You can reverse this, if you prefer.','Newest first<input type=\\\\\"radio\\\\\" name=\\\\\"setting[\$setting[settingid]]\\\\\" \".iif(\$setting[value]==1,\"checked\",\"\").\" value=\\\\\"1\\\\\"> Oldest first <input type=\\\\\"radio\\\\\" name=\\\\\"setting[\$setting[settingid]]\\\\\" \".iif(\$setting[value]==0,\"checked\",\"\").\" value=\\\\\"0\\\\\">',1)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Order of comment posts','commentsorder','0','The standard (recommended) way to display comments is chronologically from original comment to the latest one. You can reverse this, if you prefer.','Newest first<input type=\\\\\"radio\\\\\" name=\\\\\"setting[\$setting[settingid]]\\\\\" \".iif(\$setting[value]==1,\"checked\",\"\").\" value=\\\\\"1\\\\\"> Oldest first <input type=\\\\\"radio\\\\\" name=\\\\\"setting[\$setting[settingid]]\\\\\" \".iif(\$setting[value]==0,\"checked\",\"\").\" value=\\\\\"0\\\\\">',2)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Maximum number of news to display.','maxnews','10','','',3)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Maximum number of headlines to display.','maxheadlines','15','','',4)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'News pages to show in nav bar','newsnavpages','3','In the list of links of pages in the current thread (or current forum), this option selects how many pages either side of the current page are shown. Set this to 0 to display all pages.','',6)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Number of characters before wrapping','newswordwrap','50','If you want posts to automatically insert spaces into long words to make them wrap after a certain number of characters, set the number of characters in the box above. If you do not want this to occur, enter 0.','',7)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Maximum Characters per news post','newspostmaxchars','10000','The maximum number of characters that you want to allow per news post. Set this to 0 to disable it.','',8)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Show default news icon','newsshowdeficon','0','Show a default news icon if a journalist doesn\'t choose a news icon or is unable to choose one based on forum settings? {imagesfolder}/newsicons/icon1.gif will be used.','yesno',9)");
$DB_site->query("INSERT INTO setting VALUES (NULL,$settinggroupid,'Stop \'Shouting\' in news titles','newsstopshouting','1','Prevent your users \'shouting\' in their news thread titles by changing all-uppercase titles to capitalization only on the first letters of some words. Disable this for some international boards with different character sets, as this may cause problems.','yesno','10')");
echo "<p>Adding <font color='#006699'>setting</font> data... Done.<br>\n"
i would like to be able to make the script check what is the last ID in settinggroup and if > then 31 to make a input code:
PHP Code:
makeinputcode("Settinggroup ID","value")
where the user can select a higher value instead of the default one.
what i try to avoid is that the user must edit the hbhome.php installer file. i could do a check link to setting.php, let the user check manually what is the last id, edit the vbhome.php file and reload the specified step... but that is cheap in my eyes
anyway, let me know if you can point me in any direction. ty