function page_save() { extract(doSlash(gpsa(array('name', 'html', 'copy')))); if ($copy) { $newname = doSlash(trim(preg_replace('/[<>&"\']/', '', gps('newname')))); if ($newname and safe_field('name', 'txp_page', "name = '{$newname}'")) { $message = gTxt('page_already_exists', array('{name}' => $newname)); } elseif ($newname) { safe_insert('txp_page', "name = '{$newname}', user_html = '{$html}'"); update_lastmod(); $message = gTxt('page_created', array('{name}' => $newname)); } else { $message = gTxt('page_name_invalid'); } page_edit($message); } else { safe_update('txp_page', "user_html = '{$html}'", "name = '{$name}'"); update_lastmod(); $message = gTxt('page_updated', array('{name}' => $name)); page_edit($message); } }
/** * Directs requests to page_edit() armed with a 'page_new' step. * * @see page_edit() */ function page_new() { page_edit(); }
function div_save() { extract(gpsa(array('html_array', 'html', 'start_pos', 'stop_pos', 'name'))); $html_array = unserialize($html_array); $repl_array = preg_split("/(<.*>)/U", $html, -1, PREG_SPLIT_DELIM_CAPTURE); array_splice($html_array, $start_pos, $stop_pos - $start_pos + 1, $repl_array); $html = doSlash(join('', $html_array)); safe_update('txp_page', "user_html = '{$html}'", "name = '" . doSlash($name) . "'"); $message = gTxt('page_updated', array('{name}' => $name)); page_edit($message); // print_r($html_array); }
function do_update_category() { $inputs = JxBotUtil::inputs('category,that,topic'); JxBotNLData::category_update($inputs['category'], $inputs['that'], $inputs['topic']); page_edit($inputs['category']); }
function div_save() { extract(gpsa(array('html_array', 'html', 'start_pos', 'stop_pos', 'name'))); $html_array = unserialize($html_array); $repl_array = preg_split("/(<.*>)/U", $html, -1, PREG_SPLIT_DELIM_CAPTURE); array_splice($html_array, $start_pos, $stop_pos - $start_pos + 1, $repl_array); $html = doSlash(join('', $html_array)); safe_update("txp_page", "user_html='{$html}'", "name='{$name}'"); page_edit(messenger('page', $name, 'updated')); # print_r($html_array); }