[44] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | /*
|
---|
| 4 | Plugin Name: ODLinks
|
---|
| 5 | Plugin URI: http://www.forgani.com
|
---|
| 6 | Description: Open Directory Links (Website directory)
|
---|
| 7 | Author: Mohammad forgani
|
---|
| 8 | Version: 1.0.1-a
|
---|
| 9 | Author URI: http://www.forgani.com
|
---|
| 10 |
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | Changes 1.0.1-a - Mar 17/03/2009
|
---|
| 14 | - Implement the search function.
|
---|
| 15 |
|
---|
| 16 | Changes 1.0.0-a - Jan 25/01/2009
|
---|
| 17 | -It covers changes between WordPress Version 2.6 and Version 2.7
|
---|
| 18 |
|
---|
| 19 | Changes Nov 23/2008
|
---|
| 20 | - implement the banned list
|
---|
| 21 |
|
---|
| 22 | - added google pagerank
|
---|
| 23 |
|
---|
| 24 | Changes Oct 17/2008
|
---|
| 25 | - implement the conformaion code (captcha)
|
---|
| 26 |
|
---|
| 27 | Changes Oct 25/2008
|
---|
| 28 | - Update the methods and tools of admin
|
---|
| 29 |
|
---|
| 30 | Changes Nov 12/2008
|
---|
| 31 | - implement the bookmark & send to your friends service
|
---|
| 32 | - edit/replace categories
|
---|
| 33 |
|
---|
| 34 | */
|
---|
| 35 |
|
---|
| 36 | global $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 |
|
---|
| 61 | if (!$odlinkstheme) {$odlinkstheme = 'default';};
|
---|
| 62 | if (!$table_prefix){
|
---|
| 63 | $table_prefix = $wpdb->prefix;
|
---|
| 64 | }
|
---|
| 65 |
|
---|
| 66 | define('ODL', 'wp-content/plugins/odlinks');
|
---|
| 67 | define('ODLADMIN', 'wp-content/plugins/odlinks/admin/');
|
---|
| 68 | define('ODLINC', 'wp-content/plugins/odlinks/includes/');
|
---|
| 69 | define('ODLADMINTHEME', 'wp-content/plugins/odlinks/themes');
|
---|
| 70 | define('ODLTHEME', 'wp-content/plugins/odlinks/themes/'.$odlinkstheme);
|
---|
| 71 | define('ODLSMARTY', 'wp-content/plugins/odlinks/includes/Smarty');
|
---|
| 72 | define('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 |
|
---|
| 80 | require_once(ABSPATH . ODLINC . '/odl_functions.php');
|
---|
| 81 | require_once(ABSPATH . ODLADMIN . '/odl_admin_functions.php');
|
---|
| 82 | require_once(ABSPATH . ODLADMIN . '/odl_admin.php');
|
---|
| 83 | require_once(ABSPATH . ODLADMIN . '/odl_admin_settings.php');
|
---|
| 84 | require_once(ABSPATH . ODLADMIN . '/odl_admin_structure.php');
|
---|
| 85 | require_once(ABSPATH . ODLADMIN . '/odl_admin_utilities.php');
|
---|
| 86 | require_once(ABSPATH . ODL . '/odl_posts.php');
|
---|
| 87 | require_once(ABSPATH . ODL . '/odl_search.php');
|
---|
| 88 | require_once(ABSPATH . ODL . '/odl_main.php');
|
---|
| 89 | require_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");
|
---|
| 93 | add_filter("the_content", "odlinkspage_handle_content");
|
---|
| 94 | add_filter("the_title", "odlinkspage_handle_title");
|
---|
| 95 | add_filter("wp_list_pages", "odlinkspage_handle_titlechange");
|
---|
| 96 | add_filter("single_post_title", "odlinkspage_handle_pagetitle");
|
---|
| 97 | add_filter("query_vars", "odlinksquery_vars");
|
---|
| 98 |
|
---|
| 99 |
|
---|
| 100 | if (function_exists('add_action')) {
|
---|
| 101 | add_action('admin_menu', 'odlinks_admin_page');
|
---|
| 102 | }
|
---|
| 103 |
|
---|
| 104 | // Assigns each respective variable.
|
---|
| 105 | if (!$_GET)$_GET = $HTTP_GET_VARS;
|
---|
| 106 | if (!$_POST)$_POST = $HTTP_POST_VARS;
|
---|
| 107 | if (!$_SERVER)$_SERVER = $HTTP_SERVER_VARS;
|
---|
| 108 | if (!$_COOKIE)$_COOKIE = $HTTP_COOKIE_VARS;
|
---|
| 109 |
|
---|
| 110 | // Format any data sent to odlinks.
|
---|
| 111 | if ($_REQUEST["odlinksaction"]){
|
---|
| 112 | $_SERVER["REQUEST_URI"] = dirname(dirname($_SERVER["PHP_SELF"]))."/".$odlinkssettings['odlinksslug']."/";
|
---|
| 113 | $_SERVER["REQUEST_URI"] = stripslashes($_SERVER["REQUEST_URI"]);
|
---|
| 114 | }
|
---|
| 115 |
|
---|
| 116 | ?>
|
---|