Changeset 1693
- Timestamp:
- 05/14/10 13:44:19 (3 years ago)
- Location:
- branches/1.3
- Files:
-
- 1 added
- 1 edited
-
Hotaru.php (modified) (88 diffs)
-
libs/smartloader.class.php (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/Hotaru.php
r1686 r1693 70 70 public function __construct($start = '') 71 71 { 72 require_once(LIBS . 'smartloader.class.php'); 72 73 // initialize Hotaru 73 if (!$start) { 74 require_once(LIBS . 'Initialize.php');74 if (!$start) { 75 75 76 $init = new Initialize($this); 77 76 78 $this->db = $init->db; // database object 77 79 $this->cage = $init->cage; // Inspekt cage … … 102 104 // Set up debugging: 103 105 if ($this->isDebug) { 104 require_once(LIBS . 'Debug.php');105 106 $this->debug = new Debug(); 106 107 } … … 378 379 public function pagination($query, $total_items, $items_per_page = 10, $cache_table = '') 379 380 { 380 require_once(LIBS . 'Paginator.php');381 381 $paginator = new Paginator(); 382 382 return $paginator->pagination($this, $query, $total_items, $items_per_page, $cache_table); … … 393 393 public function paginationFull($data, $items_per_page = 10) 394 394 { 395 require_once(LIBS . 'Paginator.php');396 395 $paginator = new Paginator(); 397 396 return $paginator->paginationFull($this, $data, $items_per_page); … … 423 422 public function breadcrumbs() 424 423 { 425 require_once(LIBS . 'Breadcrumbs.php');426 424 $breadcrumbs = new Breadcrumbs(); 427 425 return $breadcrumbs->buildBreadcrumbs($this); … … 438 436 public function rssBreadcrumbsLink($status = '', $vars = array()) 439 437 { 440 require_once(LIBS . 'Breadcrumbs.php');441 438 $breadcrumbs = new Breadcrumbs(); 442 439 return $breadcrumbs->rssBreadcrumbsLink($this, $status, $vars); … … 593 590 public function getUserNameFromId($id = 0) 594 591 { 595 require_once(LIBS . 'UserInfo.php');596 592 $userInfo = new UserInfo(); 597 593 return $userInfo->getUserNameFromId($this, $id); … … 607 603 public function getUserIdFromName($username = '') 608 604 { 609 require_once(LIBS . 'UserInfo.php');610 605 $userInfo = new UserInfo(); 611 606 return $userInfo->getUserIdFromName($this, $username); … … 621 616 public function getEmailFromId($userid = 0) 622 617 { 623 require_once(LIBS . 'UserInfo.php');624 618 $userInfo = new UserInfo(); 625 619 return $userInfo->getEmailFromId($this, $userid); … … 635 629 public function getUserIdFromEmail($email = '') 636 630 { 637 require_once(LIBS . 'UserInfo.php');638 631 $userInfo = new UserInfo(); 639 632 return $userInfo->getUserIdFromEmail($this, $email); … … 648 641 public function isAdmin($username) 649 642 { 650 require_once(LIBS . 'UserInfo.php');651 643 $userInfo = new UserInfo(); 652 644 return $userInfo->isAdmin($this->db, $username); … … 665 657 public function userExists($id = 0, $username = '', $email = '') 666 658 { 667 require_once(LIBS . 'UserInfo.php');668 659 $userInfo = new UserInfo(); 669 660 return $userInfo->userExists($this->db, $id, $username, $email); … … 681 672 public function nameExists($username = '', $role = '', $exclude = 0) 682 673 { 683 require_once(LIBS . 'UserInfo.php');684 674 $userInfo = new UserInfo(); 685 675 return $userInfo->nameExists($this, $username, $role, $exclude); … … 697 687 public function emailExists($email = '', $role = '', $exclude = 0) 698 688 { 699 require_once(LIBS . 'UserInfo.php');700 689 $userInfo = new UserInfo(); 701 690 return $userInfo->emailExists($this, $email, $role, $exclude); … … 712 701 public function getMods($permission = 'can_access_admin', $value = 'yes') 713 702 { 714 require_once(LIBS . 'UserInfo.php');715 703 $userInfo = new UserInfo(); 716 704 return $userInfo->getMods($this, $permission, $value); … … 725 713 public function getUniqueRoles() 726 714 { 727 require_once(LIBS . 'UserInfo.php');728 715 $userInfo = new UserInfo(); 729 716 return $userInfo->getUniqueRoles($this); … … 739 726 public function userIdNameList($role = '') 740 727 { 741 require_once(LIBS . 'UserInfo.php');742 728 $userInfo = new UserInfo(); 743 729 return $userInfo->userIdNameList($this, $role); … … 755 741 public function userListFull($id_array = array(), $start = 0, $range = 0) 756 742 { 757 require_once(LIBS . 'UserInfo.php');758 743 $userInfo = new UserInfo(); 759 744 return $userInfo->userListFull($this, $id_array, $start, $range); … … 769 754 public function userSettingsList($userid = 0) 770 755 { 771 require_once(LIBS . 'UserInfo.php');772 756 $userInfo = new UserInfo(); 773 757 return $userInfo->userSettingsList($this, $userid); … … 1037 1021 public function readThemeMeta($theme = 'default') 1038 1022 { 1039 require_once(LIBS . 'ThemeSettings.php');1040 1023 $themeSettings = new ThemeSettings(); 1041 1024 return $themeSettings->readThemeMeta($this, $theme); … … 1052 1035 public function getThemeSettings($theme = '', $return = 'value') 1053 1036 { 1054 require_once(LIBS . 'ThemeSettings.php');1055 1037 $themeSettings = new ThemeSettings(); 1056 1038 return $themeSettings->getThemeSettings($this, $theme, $return); … … 1068 1050 public function updateThemeSettings($settings = array(), $theme = '', $column = 'value') 1069 1051 { 1070 require_once(LIBS . 'ThemeSettings.php');1071 1052 $themeSettings = new ThemeSettings(); 1072 1053 return $themeSettings->updateThemeSettings($this, $settings, $theme, $column); … … 1155 1136 public function showMessage($msg = '', $msg_type = 'green') 1156 1137 { 1157 require_once(LIBS . 'Messages.php');1158 1138 $messages = new Messages(); 1159 1139 $messages->showMessage($this, $msg, $msg_type); … … 1166 1146 public function showMessages() 1167 1147 { 1168 require_once(LIBS . 'Messages.php');1169 1148 $messages = new Messages(); 1170 1149 $messages->showMessages($this); … … 1187 1166 public function checkAnnouncements($announcement = '') 1188 1167 { 1189 require_once(LIBS . 'Announcements.php');1190 1168 $announce = new Announcements(); 1191 1169 if ($this->isAdmin) { … … 1209 1187 public function showQueriesAndTime() 1210 1188 { 1211 if ($this->isDebug) { 1212 $this->debug->showQueriesAndTime($this);1189 if ($this->isDebug) { 1190 $this->debug->showQueriesAndTime($this); 1213 1191 } 1214 1192 } … … 1257 1235 { 1258 1236 if (!is_object($this->debug)) { 1259 require_once(LIBS . 'Debug.php');1260 1237 $this->debug = new Debug(); 1261 1238 } … … 1282 1259 public function newSimplePie($feed='', $cache=RSS_CACHE, $cache_duration=RSS_CACHE_DURATION) 1283 1260 { 1284 require_once(LIBS . 'Feeds.php');1285 1261 $feeds = new Feeds(); 1286 1262 return $feeds->newSimplePie($feed, $cache, $cache_duration); … … 1297 1273 public function adminNews($max_items = 10, $items_with_content = 3, $max_chars = 300) 1298 1274 { 1299 require_once(LIBS . 'Feeds.php');1300 1275 $feeds = new Feeds(); 1301 1276 $feeds->adminNews($this->lang, $max_items, $items_with_content, $max_chars); … … 1313 1288 public function rss($title = '', $link = '', $description = '', $items = array()) 1314 1289 { 1315 require_once(LIBS . 'Feeds.php');1316 1290 $feeds = new Feeds(); 1317 1291 $feeds->rss($this, $title, $link, $description, $items); … … 1331 1305 public function adminPages($page = 'admin_login') 1332 1306 { 1333 require_once(LIBS . 'AdminPages.php');1334 1307 $admin = new AdminPages(); 1335 1308 $admin->pages($this, $page); … … 1344 1317 public function adminLoginLogout($action = 'logout') 1345 1318 { 1346 require_once(LIBS . 'AdminAuth.php');1347 1319 $admin = new AdminAuth(); 1348 1320 return ($action == 'login') ? $admin->adminLogin($this) : $admin->adminLogout($this); … … 1355 1327 public function adminLoginForm() 1356 1328 { 1357 require_once(LIBS . 'AdminAuth.php');1358 1329 $admin = new AdminAuth(); 1359 1330 $admin->adminLoginForm($this); … … 1382 1353 if ($this->pageName == 'admin_login') { return true; } 1383 1354 1384 require_once(LIBS . 'Maintenance.php'); 1385 $maintenance = new Maintenance(); 1355 $maintenance = new Maintenance(); 1386 1356 return $maintenance->siteClosed($this, $this->lang); // displays "Site Closed for Maintenance" 1387 1357 } … … 1395 1365 public function openCloseSite($switch = 'open') 1396 1366 { 1397 require_once(LIBS . 'Maintenance.php');1398 1367 $maintenance = new Maintenance(); 1399 1368 $maintenance->openCloseSite($this, $switch); … … 1406 1375 public function optimizeTables() 1407 1376 { 1408 require_once(LIBS . 'Maintenance.php');1409 1377 $maintenance = new Maintenance(); 1410 1378 $maintenance->optimizeTables($this); … … 1420 1388 public function emptyTable($table_name = '', $msg = true) 1421 1389 { 1422 require_once(LIBS . 'Maintenance.php');1423 1390 $maintenance = new Maintenance(); 1424 1391 $maintenance->emptyTable($this, $table_name, $msg); … … 1434 1401 public function dropTable($table_name = '', $msg = true) 1435 1402 { 1436 require_once(LIBS . 'Maintenance.php');1437 1403 $maintenance = new Maintenance(); 1438 1404 $maintenance->dropTable($this, $table_name, $msg); … … 1448 1414 public function removeSettings($folder = '', $msg = true) 1449 1415 { 1450 require_once(LIBS . 'Maintenance.php');1451 1416 $maintenance = new Maintenance(); 1452 1417 $maintenance->removeSettings($this, $folder, $msg); … … 1462 1427 public function deleteSettings($setting = '', $folder = '') 1463 1428 { 1464 require_once(LIBS . 'Maintenance.php');1465 1429 $maintenance = new Maintenance(); 1466 1430 $maintenance->deleteSettings($this, $setting, $folder); … … 1476 1440 public function deleteFiles($dir = '') 1477 1441 { 1478 require_once(LIBS . 'Maintenance.php');1479 1442 $maintenance = new Maintenance(); 1480 1443 $maintenance->deleteFiles($dir); … … 1490 1453 public function clearCache($folder = '', $msg = true) 1491 1454 { 1492 require_once(LIBS . 'Maintenance.php');1493 1455 $maintenance = new Maintenance(); 1494 1456 $maintenance->clearCache($this, $folder, $msg); … … 1505 1467 public function getFiles($dir = '', $exclude = array()) 1506 1468 { 1507 require_once(LIBS . 'Maintenance.php');1508 1469 $maintenance = new Maintenance(); 1509 1470 return $maintenance->getFiles($dir, $exclude); … … 1540 1501 public function smartCache($switch = 'off', $table = '', $timeout = 0, $html_sql = '', $label = '') 1541 1502 { 1542 require_once(LIBS . 'Caching.php');1543 1503 $caching = new Caching(); 1544 1504 return $caching->smartCache($this, $switch, $table, $timeout, $html_sql, $label); … … 1558 1518 public function cacheHTML($timeout = 0, $html = '', $label = '') 1559 1519 { 1560 require_once(LIBS . 'Caching.php');1561 1520 $caching = new Caching(); 1562 1521 return $caching->cacheHTML($this, $timeout, $html, $label); … … 1580 1539 public function isBlocked($type = '', $value = '', $operator = '=') 1581 1540 { 1582 require_once(LIBS . 'Blocked.php');1583 1541 $blocked = new Blocked(); 1584 1542 return $blocked->isBlocked($this->db, $type, $value, $operator); … … 1596 1554 public function addToBlockedList($type = '', $value = 0, $msg = false) 1597 1555 { 1598 require_once(LIBS . 'Blocked.php');1599 1556 $blocked = new Blocked(); 1600 1557 return $blocked->addToBlockedList($this, $type, $value, $msg); … … 1620 1577 public function includeLanguage($folder = '', $filename = '') 1621 1578 { 1622 require_once(LIBS . 'Language.php');1623 1579 $language = new Language(); 1624 1580 $language->includeLanguage($this, $folder, $filename); … … 1636 1592 public function includeThemeLanguage($filename = 'main') 1637 1593 { 1638 require_once(LIBS . 'Language.php');1639 1594 $language = new Language(); 1640 1595 $language->includeThemeLanguage($this, $filename); … … 1844 1799 public function sendTrackback() 1845 1800 { 1846 require_once(LIBS . 'Trackback.php');1847 1801 $trackback = new Trackback(); 1848 1802 return $trackback->sendTrackback($this); … … 1917 1871 public function getCatId($cat_safe_name = '') 1918 1872 { 1919 require_once(LIBS . 'Category.php');1920 1873 $category = new Category(); 1921 1874 return $category->getCatId($this, $cat_safe_name); … … 1932 1885 public function getCatName($cat_id = 0, $cat_safe_name = '') 1933 1886 { 1934 require_once(LIBS . 'Category.php');1935 1887 $category = new Category(); 1936 1888 return $category->getCatName($this, $cat_id, $cat_safe_name); … … 1946 1898 public function getCatSafeName($cat_id = 0) 1947 1899 { 1948 require_once(LIBS . 'Category.php');1949 1900 $category = new Category(); 1950 1901 return $category->getCatSafeName($this, $cat_id); … … 1960 1911 public function getCatParent($cat_id = 0) 1961 1912 { 1962 require_once(LIBS . 'Category.php');1963 1913 $category = new Category(); 1964 1914 return $category->getCatParent($this, $cat_id); … … 1974 1924 public function getCatChildren($cat_parent_id = 0) 1975 1925 { 1976 require_once(LIBS . 'Category.php');1977 1926 $category = new Category(); 1978 1927 return $category->getCatChildren($this, $cat_parent_id); … … 1987 1936 public function getCategories($args = array()) 1988 1937 { 1989 require_once(LIBS . 'Category.php');1990 1938 $category = new Category(); 1991 1939 return $category->getCategories($this, $args); … … 2001 1949 public function getCatMeta($cat_id = 0) 2002 1950 { 2003 require_once(LIBS . 'Category.php');2004 1951 $category = new Category(); 2005 1952 return $category->getCatMeta($this, $cat_id); … … 2014 1961 * @return bool 2015 1962 */ 2016 public function addNewCategory($parent = 0, $new_cat_name = '') 2017 { 2018 require_once(LIBS . 'Category.php'); 1963 public function addCategory($parent = 0, $new_cat_name = '') 1964 { 2019 1965 $category = new Category(); 2020 return $category->add NewCategory($this, $parent, $new_cat_name);1966 return $category->addCategory($this, $parent, $new_cat_name); 2021 1967 } 2022 1968 … … 2031 1977 public function rebuildTree($parent_id = 0, $left = 0) 2032 1978 { 2033 require_once(LIBS . 'Category.php');2034 1979 $category = new Category(); 2035 1980 return $category->rebuildTree($this, $parent_id, $left); … … 2045 1990 function deleteCategory($delete_category = 0) 2046 1991 { 2047 require_once(LIBS . 'Category.php');2048 1992 $category = new Category(); 2049 1993 return $category->deleteCategories($this, $delete_category); … … 2066 2010 function countComments($digits_only = true, $no_comments_text = '') 2067 2011 { 2068 require_once(LIBS . 'Comment.php');2069 2012 $comment = new Comment(); 2070 2013 return $comment->countComments($this, $digits_only, $no_comments_text); … … 2080 2023 function countUserComments($user_id = 0) 2081 2024 { 2082 require_once(LIBS . 'Comment.php');2083 2025 $comment = new Comment(); 2084 2026 return $comment->countUserComments($this, $user_id); … … 2094 2036 public function deleteComments($user_id) 2095 2037 { 2096 require_once(LIBS . 'Comment.php');2097 2038 $comment = new Comment(); 2098 2039 return $comment->deleteComments($this, $user_id); … … 2108 2049 function getComment($comment_id = 0) 2109 2050 { 2110 require_once(LIBS . 'Comment.php');2111 2051 $comment = new Comment(); 2112 2052 return $comment->getComment($this, $comment_id); … … 2121 2061 function readComment($comment_row = array()) 2122 2062 { 2123 require_once(LIBS . 'Comment.php');2124 2063 $comment = new Comment(); 2125 2064 return $comment->readComment($this, $comment_row); … … 2142 2081 public function addWidget($plugin = '', $function = '', $args = '') 2143 2082 { 2144 require_once(LIBS . 'Widget.php');2145 2083 $widget = new Widget(); 2146 2084 $widget->addWidget($this, $plugin, $function, $args); … … 2159 2097 public function getArrayWidgets($widget_name = '') 2160 2098 { 2161 require_once(LIBS . 'Widget.php');2162 2099 $widget = new Widget(); 2163 2100 return $widget->getArrayWidgets($this, $widget_name); … … 2172 2109 public function deleteWidget($function) 2173 2110 { 2174 require_once(LIBS . 'Widget.php');2175 2111 $widget = new Widget(); 2176 2112 $widget->deleteWidget($this, $function); … … 2185 2121 public function getPluginFromFunction($function) 2186 2122 { 2187 require_once(LIBS . 'Widget.php');2188 2123 $widget = new Widget(); 2189 2124 return $widget->getPluginFromFunction($this, $function); … … 2210 2145 { 2211 2146 if (!is_object($this->email)) { 2212 require_once(LIBS . 'EmailFunctions.php');2213 2147 $this->email = new EmailFunctions(); 2214 2148 } … … 2238 2172 public function countFollowers($user_id = 0) 2239 2173 { 2240 require_once(LIBS . 'Friends.php');2241 2174 $friends = new Friends(); 2242 2175 return $friends->countFriends($this, $user_id, 'follower'); … … 2252 2185 public function countFollowing($user_id = 0) 2253 2186 { 2254 require_once(LIBS . 'Friends.php');2255 2187 $friends = new Friends(); 2256 2188 return $friends->countFriends($this, $user_id, 'following'); … … 2267 2199 public function getFollowers($user_id = 0, $return = 'array') 2268 2200 { 2269 require_once(LIBS . 'Friends.php');2270 2201 $friends = new Friends(); 2271 2202 return $friends->getFriends($this, $user_id, 'follower', $return); … … 2282 2213 public function getFollowing($user_id = 0, $return = 'array') 2283 2214 { 2284 require_once(LIBS . 'Friends.php');2285 2215 $friends = new Friends(); 2286 2216 return $friends->getFriends($this, $user_id, 'following', $return); … … 2296 2226 public function isFollower($user_id = 0) 2297 2227 { 2298 require_once(LIBS . 'Friends.php');2299 2228 $friends = new Friends(); 2300 2229 return $friends->checkFriends($this, $user_id, 'follower'); … … 2310 2239 public function isFollowing($user_id = 0) 2311 2240 { 2312 require_once(LIBS . 'Friends.php');2313 2241 $friends = new Friends(); 2314 2242 return $friends->checkFriends($this, $user_id, 'following'); … … 2324 2252 public function follow($user_id = 0) 2325 2253 { 2326 require_once(LIBS . 'Friends.php');2327 2254 $friends = new Friends(); 2328 2255 return $friends->updateFriends($this, $user_id, 'follow'); … … 2338 2265 public function unfollow($user_id = 0) 2339 2266 { 2340 require_once(LIBS . 'Friends.php');2341 2267 $friends = new Friends(); 2342 2268 return $friends->updateFriends($this, $user_id, 'unfollow'); … … 2361 2287 public function getLatestActivity($limit = 0, $userid = 0, $type = '') 2362 2288 { 2363 require_once(LIBS . 'UserActivity.php');2364 2289 $activity = new UserActivity(); 2365 2290 return $activity->getLatestActivity($this, $limit, $userid, $type); … … 2375 2300 public function activityExists($args = array()) 2376 2301 { 2377 require_once(LIBS . 'UserActivity.php');2378 2302 $activity = new UserActivity(); 2379 2303 return $activity->activityExists($this, $args); … … 2388 2312 public function insertActivity($args = array()) 2389 2313 { 2390 require_once(LIBS . 'UserActivity.php');2391 2314 $activity = new UserActivity(); 2392 2315 return $activity->insertActivity($this, $args); … … 2401 2324 public function updateActivity($args = array()) 2402 2325 { 2403 require_once(LIBS . 'UserActivity.php');2404 2326 $activity = new UserActivity(); 2405 2327 return $activity->updateActivity($this, $args); … … 2414 2336 public function removeActivity($args = array()) 2415 2337 { 2416 require_once(LIBS . 'UserActivity.php');2417 2338 $activity = new UserActivity(); 2418 2339 return $activity->removeActivity($this, $args); … … 2436 2357 public function getMessages($box = 'inbox', $type = '') 2437 2358 { 2438 require_once(LIBS . 'PrivateMessaging.php');2439 2359 $pm = new PrivateMessaging(); 2440 2360 return $pm->getMessages($this, $box, $type); … … 2450 2370 public function getMessage($message_id = 0) 2451 2371 { 2452 require_once(LIBS . 'PrivateMessaging.php');2453 2372 $pm = new PrivateMessaging(); 2454 2373 return $pm->getMessage($this, $message_id); … … 2463 2382 public function markRead($message_id = 0) 2464 2383 { 2465 require_once(LIBS . 'PrivateMessaging.php');2466 2384 $pm = new PrivateMessaging(); 2467 2385 $pm->markRead($this, $message_id); … … 2478 2396 public function deleteMessage($message_id = 0, $box = 'inbox') 2479 2397 { 2480 require_once(LIBS . 'PrivateMessaging.php');2481 2398 $pm = new PrivateMessaging(); 2482 2399 $pm->deleteMessage($this, $message_id, $box); … … 2495 2412 public function sendMessage($to = '', $from = '', $subject = '', $body = '') 2496 2413 { 2497 require_once(LIBS . 'PrivateMessaging.php');2498 2414 $pm = new PrivateMessaging(); 2499 2415 return $pm->sendMessage($this, $to, $from, $subject, $body);
Note: See TracChangeset
for help on using the changeset viewer.