- Timestamp:
- 12/19/10 11:53:59 (17 months ago)
- Location:
- branches/1.5
- Files:
-
- 1 removed
- 6 modified
-
Hotaru.php (modified) (1 diff)
-
install/index.php (modified) (1 diff)
-
install/install-upgrade.php (modified) (1 diff)
-
install/install_tables.php (modified) (1 diff)
-
libs/Category.php (deleted)
-
libs/Initialize.php (modified) (2 diffs)
-
libs/PageHandling.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/Hotaru.php
r2315 r2319 1685 1685 } 1686 1686 1687 ########################1688 ## CATEGORY FUNCTIONS ##1689 ########################1690 1691 /**1692 * Returns the category id for a given category safe name.1693 *1694 * @param string $cat_name1695 * @return int1696 */1697 public function getCatId($cat_safe_name = '')1698 {1699 $category = new Category();1700 return $category->getCatId($this, $cat_safe_name);1701 }1702 1703 1704 /**1705 * Returns the category name for a given category id or safe name.1706 *1707 * @param int $cat_id1708 * @param string $cat_safe_name1709 * @return string1710 */1711 public function getCatName($cat_id = 0, $cat_safe_name = '')1712 {1713 $category = new Category();1714 return $category->getCatName($this, $cat_id, $cat_safe_name);1715 }1716 1717 1718 /**1719 * Returns the category safe name for a given category id1720 *1721 * @param int $cat_id1722 * @return string1723 */1724 public function getCatSafeName($cat_id = 0)1725 {1726 $category = new Category();1727 return $category->getCatSafeName($this, $cat_id);1728 }1729 1730 1731 /**1732 * Returns parent id1733 *1734 * @param int $cat_id1735 * @return int1736 */1737 public function getCatParent($cat_id = 0)1738 {1739 $category = new Category();1740 return $category->getCatParent($this, $cat_id);1741 }1742 1743 1744 /**1745 * Returns child ids1746 *1747 * @param int $cat_parent_id1748 * @return int1749 */1750 public function getCatChildren($cat_parent_id = 0)1751 {1752 $category = new Category();1753 return $category->getCatChildren($this, $cat_parent_id);1754 }1755 1756 /**1757 * Returns Category list ids1758 *1759 * @param array $args1760 * @return int1761 */1762 public function getCategories($args = array())1763 {1764 $category = new Category();1765 return $category->getCategories($this, $args);1766 }1767 1768 1769 /**1770 * Returns meta description and keywords for the category (if available)1771 *1772 * @param int $cat_id1773 * @return array|false1774 */1775 public function getCatMeta($cat_id = 0)1776 {1777 $category = new Category();1778 return $category->getCatMeta($this, $cat_id);1779 }1780 1781 1782 /**1783 * Add a new category1784 *1785 * @param int $parent1786 * @param string $new_cat_name1787 * @return bool1788 */1789 public function addCategory($parent = 0, $new_cat_name = '')1790 {1791 $category = new Category();1792 return $category->addCategory($this, $parent, $new_cat_name);1793 }1794 1795 1796 /**1797 * rebuild the category tree1798 *1799 * @param int $parent_id1800 * @param int $left1801 * @return int1802 */1803 public function rebuildTree($parent_id = 0, $left = 0)1804 {1805 $category = new Category();1806 return $category->rebuildTree($this, $parent_id, $left);1807 }1808 1809 1810 /**1811 * Delete a category1812 *1813 * @param int $delete_category1814 * @return bool1815 */1816 function deleteCategory($delete_category = 0)1817 {1818 $category = new Category();1819 return $category->deleteCategory($this, $delete_category);1820 }1821 1687 1822 1688 ###################### -
branches/1.5/install/index.php
r2313 r2319 499 499 } else { 500 500 501 $tables = array('blocked', ' categories', 'miscdata', 'plugins', 'pluginhooks', 'pluginsettings', 'posts', 'postvotes', 'settings', 'tags', 'tempdata', 'tokens', 'users', 'usermeta', 'widgets');501 $tables = array('blocked', 'miscdata', 'plugins', 'pluginhooks', 'pluginsettings', 'posts', 'postvotes', 'settings', 'tags', 'tempdata', 'tokens', 'users', 'usermeta', 'widgets'); 502 502 503 503 // delete *all* tables in db: -
branches/1.5/install/install-upgrade.php
r2313 r2319 587 587 588 588 // Drop unique site_id keys 589 $sql = "ALTER TABLE `" . TABLE_CATEGORIES . "` DROP INDEX `key`";590 $h->db->query($sql); 591 $sql = "ALTER TABLE `" . TABLE_CATEGORIES . "` ADD UNIQUE KEY `key` (`category_name`)";589 $sql = "ALTER TABLE `".DB_PREFIX."categories` DROP INDEX `key`"; 590 $h->db->query($sql); 591 $sql = "ALTER TABLE `".DB_PREFIX."categories` ADD UNIQUE KEY `key` (`category_name`)"; 592 592 $h->db->query($sql); 593 593 -
branches/1.5/install/install_tables.php
r2313 r2319 60 60 61 61 62 // CATEGORIES TABLE - categories63 64 if ($table_name == "categories") {65 //echo "table doesn't exist. Stopping before creation."; exit;66 $sql = "CREATE TABLE `" . DB_PREFIX . $table_name . "` (67 `category_id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,68 `category_parent` int(11) NOT NULL DEFAULT '1',69 `category_name` varchar(64) NOT NULL DEFAULT '',70 `category_safe_name` varchar(64) NOT NULL DEFAULT '',71 `rgt` int(11) NOT NULL DEFAULT '0',72 `lft` int(11) NOT NULL DEFAULT '0',73 `category_order` int(11) NOT NULL DEFAULT '0',74 `category_desc` text NULL,75 `category_keywords` varchar(255) NULL,76 `category_updatedts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,77 `category_updateby` int(20) NOT NULL DEFAULT 0,78 UNIQUE KEY `key` (`category_name`)79 ) ENGINE=" . DB_ENGINE . " DEFAULT CHARSET=" . DB_CHARSET . " COLLATE=" . DB_COLLATE . " COMMENT='Categories';";80 echo $lang['install_step2_creating_table'] . ": '" . DB_PREFIX . $table_name . "'...<br />\n";81 $db->query($sql);82 83 $sql = "INSERT INTO " . DB_PREFIX . $table_name . " (category_name, category_safe_name) VALUES (%s, %s)";84 $db->query($db->prepare($sql, urlencode('All'), urlencode('all')));85 }86 87 88 62 // MISCDATA TABLE - for storing default permissions, etc. 89 63 -
branches/1.5/libs/Initialize.php
r2316 r2319 113 113 $tableConstants = array( 114 114 'TABLE_BLOCKED' => 'blocked', 115 'TABLE_CATEGORIES' => 'categories',116 115 'TABLE_MISCDATA' => 'miscdata', 117 116 'TABLE_PLUGINS' => 'plugins', … … 158 157 require_once(FUNCTIONS.'funcs.arrays.php'); 159 158 require_once(FUNCTIONS.'funcs.times.php'); 160 require_once(FUNCTIONS.'funcs.files.php');161 159 require_once(FUNCTIONS.'funcs.http.php'); 162 160 } -
branches/1.5/libs/PageHandling.php
r2301 r2319 351 351 // if we're using categories and the category is not "all"... 352 352 if ($h->isActive('categories') && $h->post->category > 1) { 353 $url .= $h-> getCatSafeName($h->post->category).'/';353 $url .= $h->vars['category']->getCatSafeName($h, $h->post->category).'/'; 354 354 } 355 355 … … 357 357 } elseif ($key == 'category' && is_numeric($value)) { 358 358 359 $url .= $key.'/'.$h-> getCatSafeName($value).'/';359 $url .= $key.'/'.$h->vars['category']->getCatSafeName($h, $value).'/'; 360 360 } elseif ($key == 'page') { 361 361