-1

Addpages.php

<?phpclass DivineAddPages {  private function DBString($string) {        return str_replace(array("''", "\\"), array("''", "\\\\"), $string);    }           public function Add($link, $title, $content, $comments = true) {        $result = mysql_query("SELECT ID FROM wp_posts WHERE post_name = '{$this->DBString($link)}' LIMIT 1");                if ($result) {            list($post_id) = mysql_fetch_row($result);        } else {            $post_id = 0;        }                $comment_status = $comments ? 'open' : 'closed';                if(!$post_id) {         mysql_query("               INSERT wp_posts             SET                 post_name = '{$this->DBString($link)}',                 post_title = '{$this->DBString($title)}',                   post_content = '{$this->DBString($content)}',                   post_status = 'publish',                    comment_status = '{$comment_status}',                   post_author = 1,                    post_date = NOW(),                  post_date_gmt = NOW(),                  post_modified = NOW(),                  post_modified_gmt = NOW(),                  post_type = 'page'          ");     } else {            mysql_query("               UPDATE wp_posts             SET                 post_name = '{$this->DBString($link)}',                 post_title = '{$this->DBString($title)}',                   post_content = '{$this->DBString($content)}',                   post_status = 'publish',                    comment_status = '{$comment_status}',                   post_author = 1,                    post_date = NOW(),                  post_date_gmt = NOW(),                  post_modified = NOW(),                  post_modified_gmt = NOW(),                  post_type = 'page'              WHERE                   ID = {$post_id}         ");     }   }       public function Link($link) {       if(in_array('mod_rewrite', apache_get_modules())) {         return get_bloginfo('url').'/'.$link;       } else {            list($post_id) = mysql_fetch_row(mysql_query("SELECT ID FROM wp_posts WHERE post_name = '{$this->DBString($link)}' LIMIT 1"));          return get_bloginfo('url').'/?p='.$post_id;     }   }       public function SetPermalinksOption() {         mysql_query("UPDATE wp_options SET option_value = '/%post_id%' WHERE option_name = 'permalink_structure'"); }           public function DivineAddPages() {  }}$div_ap = new DivineAddPages();?>

i need hep ASAP

6
Contributors
6
Replies
23
Views
4 Years
Discussion Span
Last Post by diafol
0

i need hep ASAP

If you want someone to help you then you need to fix your code. I don't think anyone can read it.

0

I have not the faintest idea of whether that is a code fragment, or a bunch of letters dumped ...

"A man's ability is shown in how he handles his tools"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.