Posted on: 11/24/05 12:15am
By: phpsocialclub
<?php /* By Andrew Gray andrew@graymerica.com For Geeklog 1.4 with FCKeditor ###INSTALL Put this file in the {Path to Geeklog HTML}/javascript/ folder Add the following line to line 41 of {Path to Geeklog HTML}/fckeditor/editor/dialog/fck_link.html <script src="/javascript/CMSlinks.php"></script> */ include("../lib-common.php") ; //Probably should respect security $sql = "SELECT sp_id , sp_title FROM {$_TABLES['staticpage']} WHERE 1" ; $recordset = DB_query($sql) ; $result = DB_fetchArray(DB_query($sql)) ; //There is probably a better more GL way to do this while ($i <= DB_numRows($recordset)) { $val = DB_fetchArray($recordset) ; $url = COM_buildURL ($_CONF['site_url'] . '/staticpages/index.php?page=' . $val[0]); $staticPagesDropDown .= 'document.write( '<OPTION value="' . $url . '"> ' . htmlentities($val[1]) . ' </OPTION>' ); ' ; $i++ ; } ?> //### function to change FCKeditor text field when the Drop Down is changed function CMSdrop() { var newUrl = GetE('cmslink').value ; GetE('txtUrl').value = newUrl ; } //### Write the HTML needed, put here so we do not have to edit much in FCKeditor source document.write('<tr><td colspan="3">Internal Link ') ; document.write('<select id="cmslink" onChange="CMSdrop();"> ') ; <?php echo $staticPagesDropDown ; ?> document.write('</select></td></tr>') ;