source: trunk/www.guidonia.net/wp/wp-content/plugins/odlinks/odl_control.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 3.8 KB
Line 
1<?php
2
3/*
4Plugin Name: ODLinks
5Plugin URI: http://www.forgani.com
6Description: Open Directory Links (Website directory)
7Author: Mohammad forgani
8Version: 1.0.1-a
9Author URI: http://www.forgani.com
10
11
12
13Changes 1.0.1-a - Mar 17/03/2009
14- Implement the search function.
15
16Changes 1.0.0-a - Jan 25/01/2009
17-It covers changes between WordPress Version 2.6 and Version 2.7
18
19Changes Nov 23/2008
20- implement the banned list
21
22- added google pagerank
23
24Changes Oct 17/2008
25 - implement the conformaion code (captcha)
26
27Changes Oct 25/2008
28- Update the methods and tools of admin
29
30Changes Nov 12/2008
31- implement the bookmark & send to your friends service
32- edit/replace categories
33
34*/
35
36global $table_prefix, $wpdb;
37$odlinkssettings = get_option('odlinksdata');
38$odlinkstheme = $odlinkssettings['odlinkstheme'];
39
40// Sets the version number.
41$odlinksversion = "1.0";
42// Sets the required user level.
43$odlinksuser_level = 8;
44// Sets the Management page tab name in WordPress Admin area.
45$odlinksadmin_page_name = 'ODLinks';
46// Sets the odlinks page link name in WordPress.
47$odlinks_name = 'odlinks';
48$odlinksuser_field = false;
49// Sets $odlinkswp_mainversion to false.
50$odlinkswp_mainversion = false;
51// Sets $odlinkswp_pageinfo to false.
52$odlinkswp_pageinfo = false;
53// Admin links and their url args.
54$odlinksadmin_links = array(
55 array('name'=>'ODLINKS Settings','arg'=>'odlinkssettings',prg=>'process_odlinkssettings'),
56 array('name'=>'ODLINKS Structure','arg'=>'odlinksstructure',prg=>'process_odlinksstructure'),
57 array('name'=>'ODLINKS Links','arg'=>'odlinksposts',prg=>'process_odlinksposts'),
58 array('name'=>'ODLINKS Utilities','arg'=>'odlinksutilities',prg=>'process_odlinksutilities'),
59);
60
61if (!$odlinkstheme) {$odlinkstheme = 'default';};
62if (!$table_prefix){
63 $table_prefix = $wpdb->prefix;
64}
65
66define('ODL', 'wp-content/plugins/odlinks');
67define('ODLADMIN', 'wp-content/plugins/odlinks/admin/');
68define('ODLINC', 'wp-content/plugins/odlinks/includes/');
69define('ODLADMINTHEME', 'wp-content/plugins/odlinks/themes');
70define('ODLTHEME', 'wp-content/plugins/odlinks/themes/'.$odlinkstheme);
71define('ODLSMARTY', 'wp-content/plugins/odlinks/includes/Smarty');
72define('ODLANG', 'wp-content/plugins/odlinks/languages/');
73
74$smarty_template_dir = ABSPATH . ODLTHEME;
75$smarty_compile_dir = ABSPATH . ODLSMARTY . '/templates_c';
76$smarty_cache_dir = ABSPATH . ODLSMARTY . '/cache';
77$smarty_config_dir = ABSPATH . ODLSMARTY . '/configs';
78
79
80require_once(ABSPATH . ODLINC . '/odl_functions.php');
81require_once(ABSPATH . ODLADMIN . '/odl_admin_functions.php');
82require_once(ABSPATH . ODLADMIN . '/odl_admin.php');
83require_once(ABSPATH . ODLADMIN . '/odl_admin_settings.php');
84require_once(ABSPATH . ODLADMIN . '/odl_admin_structure.php');
85require_once(ABSPATH . ODLADMIN . '/odl_admin_utilities.php');
86require_once(ABSPATH . ODL . '/odl_posts.php');
87require_once(ABSPATH . ODL . '/odl_search.php');
88require_once(ABSPATH . ODL . '/odl_main.php');
89require_once(ABSPATH . ODLINC . '/captcha_class.php');
90
91#add_action("generate_rewrite_rules","odlinksrewrite_rules_wp");
92#add_action("mod_rewrite_rules", "odlinksrewrite_rules_wp");
93add_filter("the_content", "odlinkspage_handle_content");
94add_filter("the_title", "odlinkspage_handle_title");
95add_filter("wp_list_pages", "odlinkspage_handle_titlechange");
96add_filter("single_post_title", "odlinkspage_handle_pagetitle");
97add_filter("query_vars", "odlinksquery_vars");
98
99
100if (function_exists('add_action')) {
101 add_action('admin_menu', 'odlinks_admin_page');
102}
103
104// Assigns each respective variable.
105if (!$_GET)$_GET = $HTTP_GET_VARS;
106if (!$_POST)$_POST = $HTTP_POST_VARS;
107if (!$_SERVER)$_SERVER = $HTTP_SERVER_VARS;
108if (!$_COOKIE)$_COOKIE = $HTTP_COOKIE_VARS;
109
110// Format any data sent to odlinks.
111if ($_REQUEST["odlinksaction"]){
112 $_SERVER["REQUEST_URI"] = dirname(dirname($_SERVER["PHP_SELF"]))."/".$odlinkssettings['odlinksslug']."/";
113 $_SERVER["REQUEST_URI"] = stripslashes($_SERVER["REQUEST_URI"]);
114}
115
116?>
Note: See TracBrowser for help on using the repository browser.