• I am trying WP_Wikibox Plugin but doesn’t like to have another idea. Is it possible to add code in single.php to get a summary – let’s say 250 words – automatically based on the post’s tags? It should display “boxes” between every box should be a br-tag or p-tag. Any ideas?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter antishape

    (@antishape)

    This is the code – i guess – that need the plugin WP-Wikibox to get summary from wikipedia.
    https://pastebin.com/HR8A9pkr

    How to change it to my needs?
    -Only get 100, 200 or 250 words of the article.
    -get tags from my post, get wiki articles’ summary
    -do linebreak (br or p) and then add the next summary from a tag if there’s one.
    -should be displayed in boxes.

    Any ideas?

    Thread Starter antishape

    (@antishape)

    <?php
    $query = $_SERVER['QUERY_STRING'];
    $search = $_GET['search'];
    ?>
    <h1><?php if (isset($search)) echo $search; ?></h1>
    
    function callback( $puffer ) { 
    
    $puffer = substr( $puffer, strpos( $puffer, '<!-- start content -->' ) );
    $puffer = substr( $puffer, 0, strpos( $puffer, '<div class="printfooter">' ) );
    $puffer = str_replace( "/w/index.php", "/wikipedia/wikistatic.php", $puffer );
    $puffer = str_replace( "/wiki/", "/wikipedia/wikistatic.php?title=Spezial:Search&search=", $puffer );
    $puffer = '<style>.editsection {display:none;}</style>'.$puffer;
    ($puffer);
    return $puffer;
    }
    if(eregi("Spezial:Search",$query) or eregi("Spezial%3aSearch",$query) or eregi("Special:Search",$query)) {
    $search = str_replace( " ", "+", $search );
    ob_start("callback");
    include 'https://de.wikipedia.org/w/index.php?'.$query;
    ob_end_flush();
    }
    print( '<small><p>
    Text und Bilder dieses Beitrags stammen aus dem Artikel
    <a href="https://de.wikipedia.org/wiki/'.$begriff.'" title="https://de.wikipedia.org/wiki/'.$begriff.'" target="_blank">'.$search.'</a>
    der freien Enzyklop&auml;die <a href="https://de.wikipedia.org" title="https://de.wikipedia.org" target="_blank">Wikipedia</a>
    und stehen unter der <a href="https://www.gnu.org/licenses/fdl.txt" target="_blank">GNU Free Documentation License</a>.
    Die Liste der Autoren ist in der Wikipedia unter
    <a href="https://de.wikipedia.org/w/wiki.phtml?title='.$search.'&action=history" target="_blank" title="https://de.wikipedia.org/w/wiki.phtml?title='.$search.'&action=history">dieser Seite</a> verf&uuml;gbar, der Original-Artikel l&auml;sst sich
    <a href="https://de.wikipedia.org/w/wiki.phtml?title='.$search.'&action=edit" target="_blank" title="hierhttps://de.wikipedia.org/w/wiki.phtml?title='.$search.'&action=edit">hier</a>
    bearbeiten.
    </p></small>');
    ?>

    This is code I found. Now I’d like to know how to modify it to get the results I want. Summary of 100-150 words, based on tags – all of this automatically.

    Any ideas?

    Thread Starter antishape

    (@antishape)

    Is it possible to get tags one after another and process one after another with file() to readout the article(s) like get 100-150 words from https://en.wikipedia.org/tagone, https://en.wikipedia.org/tagtwo etc.
    and display it one after another

    Tagone

    Tagtwo

    etc.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how to get wiki-summary based on tags?’ is closed to new replies.