function action_import() { if (!empty($_REQUEST['ebay_account_name'])) { $name = $_REQUEST['ebay_account_name']; $bean = BeanFactory::getBean('xeBayAccounts'); $accounts = $bean->get_accounts($name); } $categories = new GetCategories(); foreach ($accounts as $id => $authToken) { $count = $categories->retrieveCategories(array('AccountID' => $id, 'AuthToken' => $authToken)); } if (isset($_REQUEST['return_module']) && isset($_REQUEST['return_action']) && isset($_REQUEST['return_id'])) { $this->redirect_url = "index.php?module={$_REQUEST['return_module']}&action={$_REQUEST['return_action']}&record={$_REQUEST['return_id']}"; } else { sugar_cleanup(true); } }
# Check if we're installed if (!isset($host)) { $Install = new Install(); if (isset($_GET['install'])) { $pass = safe($_POST['pass']); if ($pass == "SQL Pass") { $pass = ''; } $Install->Generate(safe($_POST['host']), safe($_POST['user']), $pass, safe($_POST['name'])); $Install->Done(); } $Install->HTML(); $Install->Done(); die; } else { # HardCore Code # General Functions # Get Setting from DB # HTML & PHP Include include_once dirname(__FILE__) . "/Header.index.php"; } if (isset($_GET['category']) && GetCategories::categoryExists($_GET['category'])) { include_once dirname(__FILE__) . "/Posts.index.php"; } else { if (isset($_GET['post']) && count(GetPosts::getPostId($_GET['post'])) > 1) { include_once dirname(__FILE__) . "/Post.index.php"; } else { include_once dirname(__FILE__) . "/Categories.index.php"; } } include_once dirname(__FILE__) . "/Footer.index.php";
} $time = microtime(true) - $time; $this->enterResult($time); } public function run() { $this->name = "get_categories"; $this->category = "Category Functions"; $this->description = "Tests get_categories"; //$this->randomTest(); $this->constantTest(); } } //end of GetCategories //run WpInsertPost $test = new GetCategories($suite, $runs); $test->run(); class GetCatID extends PerformanceTest { protected function constantTest() { $post_id_1 = 0; $time = microtime(true); for ($i = 0; $i < $this->runNumber; $i++) { get_cat_id("Uncategorized"); } $time = microtime(true) - $time; $this->enterResult($time); } public function run() {
<div id="main" class="grid_8 alpha"> <?php $p = new GetPosts($_GET['category']); $cat = GetCategories::nameForId($_GET['category']); $posts = $p->getPosts(5, 1); foreach ($posts as $post) { ?> <article class="post"> <h2><a href="#"><?php echo $post['title']; ?> </a></h2> <a href="#"><img src="<?php echo full_upload_path($post['image']); ?> " alt="" class="thumbnail alignleft" /></a> <p> <?php echo $post['content']; ?> </p> <div class="clear"></div> <footer class="postmeta"> <span class="btn alignleft"> In <a href="?category=<?php echo $_GET['category']; ?>
<div id="main" class="grid_8 alpha"> <?php $post = GetPosts::getPostId($_GET['post']); $cat = GetCategories::nameForId($post['category_id']); ?> <article class="post"> <h2><a href="#"><?php echo $post['title']; ?> </a></h2> <a href="#"><img src="<?php echo full_upload_path($post['image']); ?> " alt="" class="thumbnail alignleft" /></a> <p> <?php echo $post['content']; ?> </p> <div class="clear"></div> <footer class="postmeta"> <span class="btn alignleft"> In <a href="?category=<?php echo $_GET['category']; ?> "><?php echo $cat;