Odpowiedź forum utworzona

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter conixus

    (@conixus)

    nie pchajcie się tak z odpowiedzią po kolei spokojnie !

    Thread Starter conixus

    (@conixus)

    jest to wogóle możliwe ???

    Thread Starter conixus

    (@conixus)

    Pojęcia nie mam: (
    ale na pewno używam wtyczki WP-Autoblog to chyba jest ona Odpowiedzialna za wpisy no i mam jeszcze plik we wtyczkach related-post.php wygląda on tak:

    <? php
    / *
    Nazwa Plugin: Related Posts
    Plugin URI: http:/www.wasabi.com/archives/2006/02/02/wordpress-related-entries-20
    Opis: Zwraca liste Podobne wpisy na Aktywne / pasywne dopasowania słowa kluczowego.
    Wersja: 2.04
    Autor: Alexander Malov Mike Lu & Jon Bourne
    * /

    / / Rozpoczęcie instalacji

    global $ ran_plugin;
    if (isset ($ ran_plugin)) (
    $ Ran_plugin = true;
    if (isset ($ _REQUEST [ 'setup’])) / / Ustawienia jest inicjowana powiązanych za pośrednictwem, posts.php? konfiguracji
    (
    global $ file_path $ user_level;
    require_once (dirname (__FILE__ ).’/../../’. „wp-config.php ’);
    get_currentuserinfo ();
    if ($ user_level <8)
    die ( „Przepraszamy, ale musisz być co najmniej NA POZIOMIE 8 użytkowników.”) / / upewnij się, Że użytkownik ma wystarczające uprawnienia

    / / Zapytań do SQL konfiguracji rzeczywistego indeksu calego tekstu

    require (dirname (__FILE__ ).’/../../’. „wp-config.php ’);

    global $ table_prefix;

    $ Związku = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) or die ( „Can’t connect” .. mysql_error ());
    $ Dbconnexion = mysql_select_db (DB_NAME $ Związku);

    if ($ dbconnexion)
    (
    echo mysql_error ();
    die ();
    )
    $ Sql_run = 'ALTER TABLE '. $ Table_Prefix. "Stanowisk" ADD FULLTEXT "post_related ( post_name, ’
    . ’ `Post_content)”;
    $ Sql_result = mysql_query ($ sql_run);

    if ($ sql_result)
    echo ( „Gratulacje! Pełny indeks tekst zostal pomyślnie Utworzony!”);

    W przeciwnym razie
    echo ( „Coś poszło nie tak. zapoznaj się z instrukcjami na temat przygotowania pełny indeks tekst ręcznie.”);
    )
    )

    / / Setup End

    / / Rozpoczęcie Related Posts

    Related_posts Funkcja ($ return_bool = false, $ limit = 5, $ len = 10, $ before_title =”, $ after_title =”, $ before_post =”, $ after_post =”, $ show_pass_post = false, $ show_excerpt = false) (

    global $ wpdb, $ post;

    / / Pobranie Wartości opcji na stronie opcji

    $ Limit = get_option ( „Granica”);
    $ Len = get_option ( „len”);
    $ Before_title = stripslashes (get_option ( 'before_title’));
    $ After_title = stripslashes (get_option ( 'after_title’));
    $ Before_post = stripslashes (get_option ( 'before_post’));
    $ After_post = stripslashes (get_option ( 'after_post’));
    $ Show_pass_post = get_option ( „show_pass_post ’);
    $ Show_excerpt = get_option ( „show_excerpt ’);

    / / Słowa kluczowe Pobieranie

    $ Postcustom = get_post_custom_values ( „keyword”);
    if (! empty ($ postcustom)) (
    $ Values = array_map ( 'trim’, $ postcustom);
    $ Ogólne = implode ($ values ,”);
    ) Inne (
    $ Warunkach (’-’, str_replace = ’, $ post-> post_name);
    )

    / / Upewnij się, PO nie jest Że z Przyszłości

    $ Time_difference = get_settings ( „gmt_offset ’);
    Teraz gmdate = $ ( „Ymd H: i: s”, (time_difference Czas ()+($ * 3600)));

    if (! limit $) $ limit = „+0, 3 ’, / / Quick ustalić dla” nie defaults „bug 28,9

    / / Podstawowe zapytania SQL

    $ Sql = „SELECT ID, post_title, post_content,
    . „Match (post_name, post_content)”
    . „Against ( '$ warunki”) jako wynik „
    . „Z $ wpdb-> posts WHERE”
    . „Match (post_name, post_content)”
    . „Against ( '$ warunki’)”
    . „AND post_date <= '$ teraz'”
    . „AND (post_status IN ( 'publish’, 'static’) & & ID! =” $ Post-> ID ’) „;
    if ($ show_pass_post == 'false’) ($ sql .= „I =””;) post_password
    $ Sql .= „ORDER BY ocena DESC LIMIT $ limit”
    $ Results = $ wpdb-> get_results ($ sql);
    $ Output =”;
    if ($ results) (
    if ($ return_bool) (
    return true;
    )
    inny (
    foreach ($ results as $ result) (
    $ Title = stripslashes (apply_filters ( „the_title ’, $ result-> post_title));
    $ Permalink = get_permalink ($ result-> id);
    $ Post_content = strip_tags ($ result-> post_content);
    $ Post_content = stripslashes ($ post_content);
    $ Output .= $ before_title. . $ Title. „& Lt / a>. $ After_title;
    if ($ show_excerpt == 'true’) (
    Ze $ = substr ($ post_content, 0, $ len);
    Ze $ = substr ($ ze, 0, strrpos ($ ze ,”));
    ze = $ ze. '…’;
    $ Output .= $ before_post. Ze $. $ After_post;
    / / $ Słowa = split ( „”, $ post_content);
    / / $ Post_strip = join ( „”, array_slice ($ słów, 0, $ len))
    / / $ Output .= $ before_post. $ Post_strip. $ After_post;
    )
    )
    echo $ output;
    )
    ) Inne (
    if ($ return_bool) (
    return false;
    ) Inne (
    echo $ before_title. „No related posts. $ After_title;
    )
    )
    )

    related_posts_exist function () (
    powrót related_posts (true);
    )

    / / End Related Posts

    / / Rozpoczęcie Słowa kluczowe

    Find_keywords Funkcja ($ id) (
    global $ wpdb;
    $ Content = $ wpdb-> get_var ( „SELECT post_content FROM $ wpdb-> posts WHERE id = '$ id'”);
    if (preg_match_all (’/<!– kw = ([\ s \ S ]*?)–>/ i „, $ content, $ matches, PREG_SET_ORDER)) (
    $ Test = $ wpdb-> get_var ( „SELECT meta_value FROM $ wpdb-> postmeta WHERE post_id = '$ id’ AND meta_key =” keyword „);
    if (! empty ($ test)) (
    $ Wynik = explode (”, $ test);
    ) Inne (
    $ Wynik = array ();
    )
    foreach ($ matches as $ match) (
    $ Wynik = array_merge ($ output, explode (”, $ match [1]));
    )
    $ Output = array_unique ($ output);
    $ Keywords = implode (”, $ output);
    if (! empty ($ test)) (
    $ Results = $ wpdb-> query ( „UPDATE $ wpdb-> meta_value SET postmeta = '$ keywords’ WHERE post_id = '$ id’ AND meta_key =” keyword „);
    ) Inne (
    $ Results = $ wpdb-> query ( „INSERT INTO $ wpdb-> postmeta (post_id, meta_key, meta_value) VALUES ( '$ id’, 'kluczowych’, '$ kluczowych’)”);
    )
    $ Content = format_to_post (balanceTags (preg_replace („/<!– kw = ([\ s \ ]*?)–>/ S i „”<!–$ 1 –>”, $ zawartości)));
    $ Content = str_replace („'”, „, $ content) / / Fix for 'w $ content
    $ Results = $ wpdb-> query ( „UPDATE $ wpdb-> posts SET post_content = '$ content’ WHERE id = '$ id'”);
    )
    return $ id;
    )

    / / End Słowa kluczowe

    / / Rozpoczęcie Related Posts Opcje

    rp_subpanel function () (
    if (isset ($ _POST [ 'update_rp’])) (
    $ Option_limit = $ _POST [ 'limit’];
    len option_len = $ _POST [ ’];
    $ Option_before_title = $ _POST [ 'before_title’];
    $ Option_after_title = $ _POST [ 'after_title’];
    $ Option_before_post = $ _POST [ 'before_post’];
    $ Option_after_post = $ _POST [ 'after_post’];
    $ Option_show_pass_post = $ _POST [ 'show_pass_post’];
    $ Option_show_excerpt = $ _POST [ 'show_excerpt’];
    UPDATE_OPTION ( „Granica”, $ option_limit);
    UPDATE_OPTION ( 'len’, $ option_len);
    UPDATE_OPTION ( „before_title ’, $ option_before_title);
    UPDATE_OPTION ( „after_title ’, $ option_after_title);
    UPDATE_OPTION ( „before_post ’, $ option_before_post);
    UPDATE_OPTION ( „after_post ’, $ option_after_post);
    UPDATE_OPTION ( „show_pass_post ’, $ option_show_pass_post);
    UPDATE_OPTION ( „show_excerpt ’, $ option_show_excerpt);
    ?> <div Class=”updated”> <p> zapisane Opcje </ p> </ div> <? Php
    )
    ?>

    <div class=”wrap”>
    <h2> Related Posts Opcje </ h2>
    <form method=”post”>
    <fieldset class=”options”>
    <table>
    <tr>
    <td> <label for=”limit”> Ile związanych stanowisk chcesz pokazać? </ label> </ td>
    <td> <input name = „limit” type = „text” id = „Limit” value = „<? get_option echo (” Granica „);?>” size = „2” /> < / td>
    </ tr>
    <tr>
    <td> <label for=”before_title”> Przed </ label> / <label for=”after_title”> After (Post Title) </ label> </ td>
    <td> <input name = „before_title” type = „text” id = „before_title” value = „<? echo strip_tags (stripslashes (get_option ( 'before_title’)));?>” size =” 10 „/> / <input name =” after_title „type =” text „id =” after_title „value =” <? echo strip_tags (stripslashes (get_option ( 'after_title’)));?>” rozmiar = ” 10 „/> <small> Na Przykład:

    • </ li> Lub <dl> </ dl> </ small> </ em>
      </ td>
      </ tr>
      <tr>
      <td> Pokaż fragment </ td>
      <td>
      <select name=”show_excerpt” id=”show_excerpt”>
      Jesli <option (get_option (’) „show_excerpt ==’ fałszywe’) (echo’ stron’;)> value = „false”> false </ option>
      Jesli <option (get_option (’) „show_excerpt ==’ prawdziwe’) (echo’ stron’;)> value = „true”> True </ option>
      </ select>
      </ td>
      </ tr>
      <tr>
      <td> <label for=”len”> długość Fragment (Liczba słów): </ label> </ td>
      <td> <input name = „Len” type = „text” id = „len” value = „<? get_option echo (len „);?>” size =” 2 „/>
      </ tr>
      <tr>
      <td> <label for=”before_post”> Przed </ label> / <label for=”after_post”> Po </ label> (wyciąg): </ td>
      <td> <input name = „before_post” type = „text” id = „before_post” value = „<? echo strip_tags (stripslashes (get_option ( 'before_post’)));?>” size =” 10 „/> / <input name =” after_post „type =” text „id =” after_post „value =” <? echo strip_tags (stripslashes (get_option ( 'after_post’)));?>” rozmiar = ” 10 „/> <small> Na Przykład: </ li>
    • </ li> Lub <dl> </ dl> </ small> </ em>
      </ td>
      </ tr>
      <tr>
      <td> <label for=”show_pass_post”> Pokaż posty chroniony hasłem? </ label> </ td>
      <td>
      <select name=”show_pass_post” id=”show_pass_post”>
      <option („show_pass_post’) Jesli (get_option ==’ fałszywe’) (echo’ stron’;)> value = „false”> false </ option>
      <option („show_pass_post’) Jesli (get_option ==’ prawdziwe’) (echo’ stron’;)> value = „true”> True </ option>
      </ select>
      </ td>
      </ tr>
      </ table>
      </ fieldset>

      <p> <div class=”submit”> <input type = „submit” name = „update_rp” value = „<? php _e (” Save „,” update_rp’)?>” stylu = „font-weight: bold;” /> </ div> </ p>

      </ form>

      </ div>

      <div class=”wrap”>
      <h2> SQL Indeks Tabela instalacji </ h2>
      Jesli nie <p> jest twój pierwszy raz zainstalowanie tej wtyczki musisz Uruchomić <href =”../ wp-content/plugins/related-posts.php? Setup „onclick =” window.open (this.href, popupwindow ” „width = 400, height = 150, scrollbars, resizable ’); return false”> skrypt </ a> (otwiera nowe okno) w ceļu Stworzenia Tabeli indeksu Wymaga wtyczki. Jesli nie, zajrzyj do readme Stworzyć Sposób w jaki go ręcznie. </ P>

      </ div>

      <? php)

      / / End Related Posts Opcje

      Rp_admin_menu Funkcja () (
      if (function_exists ( „add_submenu_page ’)) (
      add_submenu_page ( „plugins.php ’, __ (’ Related Posts Opcje”), __ ( 'Related Posts Opcje „), 1, __FILE__,’ rp_subpanel ’);
      )
      )

      add_action ( 'edit_post’, 'find_keywords’, 1);
      / / Add_action ( 'publish_post’, 'find_keywords’, 1);
      add_action ( 'admin_menu’, 'rp_admin_menu’);

      ?>

      pomoze ktoś?

    Thread Starter conixus

    (@conixus)

    ok dzięki udało się działa 🙂

Viewing 4 replies - 1 through 4 (of 4 total)