function metaWeblog_editPost($values) { global $config, $defualtcategoryid, $db_prefix, $mbconfig; $struct = $values['struct']; $userdetail = check_user($values['username'], $values['password']); $blog = new boblog(); $values['postid'] = floor($values['postid']); $records = $blog->getgroupbyquery("SELECT * FROM `{$db_prefix}blogs` WHERE `blogid`='{$values['postid']}'"); if ($records[0]['blogid'] == '') { xml_error("Entry does not exist."); } if (!$struct['title']) { $title = "Untitled MetaWeblogAPI Entry"; } else { $title = safe_convert($struct['title']); } if (!$struct['description']) { xml_error("You MUST provide a decription element in your post."); } else { $content = reduce_entities($struct['description']); } $nowtime = time(); if ($struct['pubDate']) { $struct['dateCreated'] = $struct['pubDate']; } if ($struct['dateCreated']) { $time = get_time_unix($struct['dateCreated']) + 3600 * $config['timezone']; } else { $time = $records[0]['pubtime']; } $newcym = date("Ym", $time); $newcd = date("d", $time); $blog->query("UPDATE `{$db_prefix}calendar` SET cyearmonth='{$newcym}', cday='{$newcd}' WHERE `cid`='{$values['postid']}'"); //writetofile ('text5.php', $struct['categories']); //For debug only if ($struct['categories'] != '') { $c_tmp = $blog->getgroupbyquery("SELECT cateid FROM `{$db_prefix}categories` WHERE `catename`='{$struct['categories']}'"); $category = $c_tmp[0]['cateid']; if ($category == '') { $category = $defualtcategoryid; } } else { $category = $records[0]['category']; } if ($values['publish'] == 1 && $struct['flNotOnHomePage'] != 1) { $property = 0; } else { $property = 3; } $query = "UPDATE `{$db_prefix}blogs` SET `title`='{$title}', `pubtime`='{$time}', `property`='{$property}', `category`='{$category}', `content`='{$content}', `editorid`='{$userdetail['userid']}', `edittime`='{$nowtime}' WHERE `blogid`='{$values['postid']}'"; recache_latestentries(); recache_currentmonthentries(); recache_categories(); //Update Category counter $blog->query($query); $xml_content = make_xml_piece("boolean", '1'); $body_xml = xml_generate($xml_content); send_response($body_xml); }
<tr><td colspan=7><a href="#unexist" onclick="checkallbox('f_s', 'checked');">{$lna[247]}</a> | <a href="#unexist" onclick="checkallbox('f_s', '');">{$lna[248]}</a></td></tr> <tr><td colspan=7 height=20></td></tr> <tr class="adminoption"><td colspan=7>{$lna[249]}{$lna[249]}<input type=radio name=opt value='del'>{$lna[78]} <input type=radio name=opt value='publish'>{$lna[340]} <input type=button value="{$lna[64]}" class='formbutton' onclick="adminSubmitAjax('f_s');"> </td></tr> eot; } $display_overall_plus .= "</table></form>"; if ($ajax == 'on') { die($display_overall_plus); } else { $display_overall .= $display_overall_plus; } } if ($job == 'publish') { $blog->query("UPDATE `{$db_prefix}blogs` SET `property`=0 WHERE `blogid`='{$itemid}'"); recache_latestentries(); if ($ajax == 'on') { @header('Location: admin.php?go=entry_draft'); } else { catchsuccess($finishok, $backtodraft); } } if ($job == 'ae') { if (!$itemid) { header("Location: index.php"); } else { acceptrequest('tid'); } switch ($itemid) { case 'noreply': $queryact = "DELETE FROM `{$db_prefix}replies` WHERE `reproperty`<>4 AND `blogid`='{$tid}'";
function scheduledpublish() { global $blog, $db_prefix, $nowtime; $blog->query("UPDATE `{$db_prefix}blogs` SET `property`=0 WHERE `property`=4 AND `pubtime`<={$nowtime['timestamp']}"); $affn = db_affected_rows(); if ($affn > 0) { if (!defined('REPLYSPECIAL')) { define('REPLYSPECIAL', 1); } include_once 'admin/cache_func.php'; recache_latestentries(); plugin_runphp('plannedpublish'); } }