function minicms($content = '') { global $MINICMS, $CONFIG, $cat, $album, $REFERER, $lang_minicms, $HTML_SUBST_DECODE, $cms_array; if ($MINICMS['dbver'] != MINICMS_DBVER) { echo "<h2>{$lang_minicms['minicms_full']} {$MINICMS['dbver']}</h2><br />{$lang_minicms['dbver_nomatch']}: " . MINICMS_DBVER . "<br />"; minicms_configure(false); //auto-updater and dont print the "go" button } $where = isset($MINICMS['ID']) ? "ID='{$MINICMS['ID']}'" : "conid='{$MINICMS['conid']}' AND type='{$MINICMS['type']}'"; $query = "SELECT * FROM {$CONFIG['TABLE_CMS']} WHERE {$where} ORDER BY cpos"; $result = cpg_db_query($query); $cms_array = cpg_db_fetch_rowset($result); $counter = 0; foreach ($cms_array as $key => $cms) { $cms_array[$key]['next_ID'] = $counter < count($cms_array) - 1 && $cms['type'] == $cms_array[$counter + 1]['type'] && $cms['conid'] == $cms_array[$counter + 1]['conid'] ? '&id2=' . $cms_array[$counter + 1]['ID'] : ''; $cms_array[$key]['prev_ID'] = $counter > 0 && $cms['type'] == $cms_array[$counter - 1]['type'] && $cms['conid'] == $cms_array[$counter - 1]['conid'] ? '&id2=' . $cms_array[$counter - 1]['ID'] : ''; $cms_array[$key]['content'] = html_entity_decode(stripslashes($cms['content'])); $counter++; } ob_start(); theme_minicms($cms_array); //$content.=ob_get_clean(); $content = ob_get_clean(); return $content; }
} $superCage = Inspekt::makeSuperCage(); $req_array = array('album', 'file', 'id', 'conid', 'type', 'cat'); foreach ($req_array as $cnf_item) { if ($superCage->get->keyExists($cnf_item)) { $request[$cnf_item] = $superCage->get->getRaw($cnf_item); } if ($superCage->post->keyExists($cnf_item)) { $request[$cnf_item] = $superCage->post->getRaw($cnf_item); } } $CONFIG['TABLE_CMS'] = $CONFIG['TABLE_PREFIX'] . "cms"; $CONFIG['TABLE_CMS_CONFIG'] = $CONFIG['TABLE_PREFIX'] . "cms_config"; $results = cpg_db_query("SHOW TABLES LIKE '{$CONFIG['TABLE_CMS_CONFIG']}'"); if (!($row = mysql_fetch_row($results))) { minicms_configure(false); } mysql_free_result($results); $results = cpg_db_query("SELECT * FROM {$CONFIG['TABLE_CMS_CONFIG']}"); while ($row = mysql_fetch_array($results)) { $MINICMS[$row['name']] = $row['value']; } // while mysql_free_result($results); $HTML_SUBST_DECODE = array_flip($HTML_SUBST); //used to reverse Coppermines init.inc.php gpc processing $MINICMS['conType'] = array('cat', 'thumb', 'img', 'section'); $MINICMS['conTypebyName'] = array_flip($MINICMS['conType']); if (defined('DISPLAYIMAGE_PHP')) { $MINICMS['type'] = $MINICMS['conTypebyName']['img']; } elseif (defined('THUMBNAILS_PHP')) {