Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Wordpress: Instalacja własnej wtyczki - problem z podstroną ustawień url
alano
post
Post #1





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 16.03.2009

Ostrzeżenie: (0%)
-----


Hej,

Spójrzcie na te wywołanie. Mam problem chyba z ustaleniem właściwego url dla skryptu w panelu admina ( zakladka settings ) ponieważ gdy wchodzę w podstronę to wyskakuje mi else czyli Not Found 404 (IMG:style_emoticons/default/sad.gif)

  1. <?php
  2. /*
  3. Plugin Name: DH Team Management
  4. Plugin URI: <a href="http://www.nazwa.pl" target="_blank">http://www.nazwa.pl</a>
  5. Description: Team Management
  6. Author: f1z
  7. Version: 1.0
  8. Author URI: <a href="http://www.nazwa.pl" target="_blank">http://www.nazwa.pl</a>
  9. */
  10.  
  11. ### options ###
  12. $demo_url = 'http://nazwa.pl/dh/wp-content/plugins/demo/';
  13. ### end opt ###
  14.  
  15. define('DEMO_URL', rtrim($demo_url,'/'));
  16. require ('xcrud/xcrud.php');
  17. require ('xcrud/xcrud_config.php');
  18. Xcrud_config::$scripts_url = DEMO_URL.'/xcrud';
  19. require ('pages.php');
  20. $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 'indks';
  21. if (method_exists('Pages', $page))
  22. $func = $page;
  23. else
  24. {
  25. header("HTTP/1.0 404 Not Found");
  26. exit('404. Not found');
  27. }
  28.  
  29. function oscimp_admin_actions() {
  30. add_options_page('OSCommerce Product Display', 'OSCommerce Product Display', 'manage_options', 'OSCommerceProductDisplay', 'wpac_option_pagee');
  31. }
  32.  
  33. add_action('admin_menu', 'oscimp_admin_actions');
  34.  
  35. function wpac_option_pagee() {
  36. if (!current_user_can('manage_options')) {
  37. wp_die('You do not have sufficient permissions to access this page.');
  38. } else {
  39.  
  40. Pages::$func();
  41.  
  42. }
  43. }
  44.  
  45. ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
memory
post
Post #2





Grupa: Zarejestrowani
Postów: 616
Pomógł: 84
Dołączył: 29.11.2006
Skąd: bełchatów

Ostrzeżenie: (0%)
-----


  1. $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 'indks';
na indeks
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 02:37